Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cached feature info in spa_add_feature_stats()
Avoid issuing I/O to the pool when retrieving feature flags information. Trying to read the ZAPs from disk means that zpool clear would hang if the pool is suspended and recovery would require a reboot. We need to ensure the list of features enabled on the pool stays resident in memory. There already exists an nvlist for this purpose called ZPOOL_CONFIG_ENABLED_FEAT in spa->spa_load_info. The features_for_write features aren't added to the list, however, in the final import phase. This patch updates spa_load_impl() so the features_for_read and features_for_write features are both added to ZPOOL_CONFIG_ENABLED_FEAT in each import phase. The full list of pool features and their initial reference counts are now available for use in spa_add_feature_stats(). In spa_add_feature_stats() we iterate over the spa_feature_table[] rather than the ZAP objects read from disk. We operate on ZPOOL_CONFIG_ENABLED_FEAT in-place and refresh the reference counts for the supported features from the values cached in the spa_t. This is sufficient for 'zpool get all' to display correct values for the unsupported@ and feature@ properties. For the unsupported features, if the reference count is 0 is shows 'inactive' otherwise it shows 'read-only'. In either case, the unsupported reference counts could not have changed after import, so it is safe to rely on the initial values. Fixes openzfs#3082 Signed-off-by: Ned Bass <[email protected]>
- Loading branch information