File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3208,6 +3208,15 @@ metaslab_segment_weight(metaslab_t *msp)
3208
3208
static boolean_t
3209
3209
metaslab_should_allocate (metaslab_t * msp , uint64_t asize , boolean_t try_hard )
3210
3210
{
3211
+ /*
3212
+ * This case will usually but not always get caught by the checks below;
3213
+ * metaslabs can be loaded by various means, including the trim and
3214
+ * initialize code. Once that happens, without this check they are
3215
+ * allocatable even before they finish their first txg sync.
3216
+ */
3217
+ if (unlikely (msp -> ms_new ))
3218
+ return (B_FALSE );
3219
+
3211
3220
/*
3212
3221
* If the metaslab is loaded, ms_max_size is definitive and we can use
3213
3222
* the fast check. If it's not, the ms_max_size is a lower bound (once
You can’t perform that action at this time.
0 commit comments