]> git.proxmox.com Git - mirror_zfs.git/commit
metaslab_verify_weight_and_frag() shouldn't cause side-effects
authorSerapheim Dimitropoulos <serapheim@delphix.com>
Thu, 5 Sep 2019 16:57:55 +0000 (01:57 +0900)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 5 Sep 2019 16:57:55 +0000 (09:57 -0700)
commit65a91b166e66a57c44b62bb5ca20ccb6f0ecc46d
treecf23826054ca86f49c16b6bc240ef64e2131d544
parent240c015ac6ea629bef1339ed2829148051c2a954
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
module/zfs/metaslab.c