diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c index 9d14a3843f19..9504b95f7522 100644 --- a/module/zfs/metaslab.c +++ b/module/zfs/metaslab.c @@ -2993,6 +2993,10 @@ metaslab_alloc(spa_t *spa, metaslab_class_t *mc, uint64_t psize, blkptr_t *bp, alloc_class = METASLAB_ROTOR_ALLOC_CLASS_DATA; if (DMU_OT_IS_METADATA(BP_GET_TYPE(bp))) alloc_class = METASLAB_ROTOR_ALLOC_CLASS_METADATA; + /* Also include these blocks in metadata (from #5182). */ + if (BP_GET_LEVEL(bp) > 0) + alloc_class = METASLAB_ROTOR_ALLOC_CLASS_METADATA; + for (d = 0; d < ndvas; d++) { error = metaslab_alloc_dva(spa, mc, psize, dva, d, hintdva,