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 @@ -3250,6 +3250,15 @@ metaslab_segment_weight(metaslab_t *msp)
3250
3250
static boolean_t
3251
3251
metaslab_should_allocate (metaslab_t * msp , uint64_t asize , boolean_t try_hard )
3252
3252
{
3253
+ /*
3254
+ * This case will usually but not always get caught by the checks below;
3255
+ * metaslabs can be loaded by various means, including the trim and
3256
+ * initialize code. Once that happens, without this check they are
3257
+ * allocatable even before they finish their first txg sync.
3258
+ */
3259
+ if (unlikely (msp -> ms_new ))
3260
+ return (B_FALSE );
3261
+
3253
3262
/*
3254
3263
* If the metaslab is loaded, ms_max_size is definitive and we can use
3255
3264
* 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