diff options
author | Brian Behlendorf <[email protected]> | 2021-06-24 14:30:02 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-24 14:30:02 -0700 |
commit | 88a4833039b4a3f08139c5b69a2300424fddfd0f (patch) | |
tree | 38270879991edc5b2f7124b144a0adba98552d33 /module/zfs | |
parent | 8f11b1d26efbdf5d654dfee6415518705b0ddf55 (diff) |
Update cache file when setting compatibility property
Unlike most other properties the 'compatibility' property is stored
in the pool config object and not the DMU_OT_POOL_PROPS object.
This had the advantage that the compatibility information is available
without needing to fully import the pool (it can be read with zdb).
However, this means we need to make sure to update both the copy of
the config in the MOS and the cache file. This wasn't being done.
This commit adds a call to spa_async_request() to ensure the copy of
the config in the cache file gets updated as well as the one stored
in the pool. This same change is made for the 'comment' property
which suffers from the same inconsistency.
Reviewed-by: Sean Eric Fagan <[email protected]>
Reviewed-by: Colm Buckley <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #12261
Closes #12276
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/spa.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 825e0f1cc..f6dce076d 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -8730,12 +8730,16 @@ spa_sync_props(void *arg, dmu_tx_t *tx) spa->spa_comment = spa_strdup(strval); /* * We need to dirty the configuration on all the vdevs - * so that their labels get updated. It's unnecessary - * to do this for pool creation since the vdev's - * configuration has already been dirtied. + * so that their labels get updated. We also need to + * update the cache file to keep it in sync with the + * MOS version. It's unnecessary to do this for pool + * creation since the vdev's configuration has already + * been dirtied. */ - if (tx->tx_txg != TXG_INITIAL) + if (tx->tx_txg != TXG_INITIAL) { vdev_config_dirty(spa->spa_root_vdev); + spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE); + } spa_history_log_internal(spa, "set", tx, "%s=%s", nvpair_name(elem), strval); break; @@ -8747,8 +8751,11 @@ spa_sync_props(void *arg, dmu_tx_t *tx) /* * Dirty the configuration on vdevs as above. */ - if (tx->tx_txg != TXG_INITIAL) + if (tx->tx_txg != TXG_INITIAL) { vdev_config_dirty(spa->spa_root_vdev); + spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE); + } + spa_history_log_internal(spa, "set", tx, "%s=%s", nvpair_name(elem), strval); break; |