Skip to content

Commit fc885f3

Browse files
authored
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 f23e040 commit fc885f3

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
@@ -1184,14 +1184,16 @@ metaslab_group_passivate(metaslab_group_t *mg)
11841184
if (msp != NULL) {
11851185
mutex_enter(&msp->ms_lock);
11861186
metaslab_passivate(msp,
1187-
metaslab_weight_from_range_tree(msp));
1187+
metaslab_weight(msp, B_TRUE) &
1188+
~METASLAB_ACTIVE_MASK);
11881189
mutex_exit(&msp->ms_lock);
11891190
}
11901191
msp = mga->mga_secondary;
11911192
if (msp != NULL) {
11921193
mutex_enter(&msp->ms_lock);
11931194
metaslab_passivate(msp,
1194-
metaslab_weight_from_range_tree(msp));
1195+
metaslab_weight(msp, B_TRUE) &
1196+
~METASLAB_ACTIVE_MASK);
11951197
mutex_exit(&msp->ms_lock);
11961198
}
11971199
}

0 commit comments

Comments
 (0)