HomeFreeBSD

metaslab_verify_weight_and_frag() shouldn't cause side-effects

Description

metaslab_verify_weight_and_frag() shouldn't cause side-effects

metaslab_verify_weight_and_frag() a verification function and
by the end of it there shouldn't be any side-effects.

The function calls metaslab_weight() which in turn calls
metaslab_set_fragmentation(). The latter can dirty and otherwise
not dirty metaslab fro the next TXGand set metaslab_condense_wanted
if the spacemaps were just upgraded (meaning we just enabled the
SPACEMAP_HISTOGRAM feature through upgrade).

This patch adds a new flag as a parameter to metaslab_weight() and
metaslab_set_fragmentation() making the dirtying of the metaslab
optional.

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #9185
Closes #9282

Details

Provenance
Serapheim Dimitropoulos <serapheim@delphix.com>Authored on Sep 5 2019, 4:57 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 5 2019, 4:57 PM
Parents
rG240c015ac6ea: Refactor checksum operations in tests
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG65a91b166e66: metaslab_verify_weight_and_frag() shouldn't cause side-effects (authored by Serapheim Dimitropoulos <serapheim@delphix.com>).Sep 5 2019, 4:57 PM