Skip to content

Commit 271b979

Browse files
pcd1193182amotin
authored andcommitted
Don't use wrong weight when passivating group
When we're passivating a metaslab group we start by passivating the metaslabs that have been activated for each of the allocators. To do that, we need to provide a weight. However, currently this erroneously always uses a segment-based weight, even if segment-based weighting is disabled. Use the normal weight function, which will decide which type of weight to use. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes #17566
1 parent 582e784 commit 271b979

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

module/zfs/metaslab.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,14 +969,16 @@ metaslab_group_passivate(metaslab_group_t *mg)
969969
if (msp != NULL) {
970970
mutex_enter(&msp->ms_lock);
971971
metaslab_passivate(msp,
972-
metaslab_weight_from_range_tree(msp));
972+
metaslab_weight(msp, B_TRUE) &
973+
~METASLAB_ACTIVE_MASK);
973974
mutex_exit(&msp->ms_lock);
974975
}
975976
msp = mga->mga_secondary;
976977
if (msp != NULL) {
977978
mutex_enter(&msp->ms_lock);
978979
metaslab_passivate(msp,
979-
metaslab_weight_from_range_tree(msp));
980+
metaslab_weight(msp, B_TRUE) &
981+
~METASLAB_ACTIVE_MASK);
980982
mutex_exit(&msp->ms_lock);
981983
}
982984
}

0 commit comments

Comments
 (0)