Skip to content

Commit b80bf4d

Browse files
committed
Revert "Check for SPA_FEATURE_DRAID_FAIL_DOMAINS at vdev_alloc()"
This should allow addition of new draids without failure domains on legacy (not upgraded) pools. This reverts commit 37e02d1.
1 parent db5ffef commit b80bf4d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

module/zfs/spa.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6895,6 +6895,10 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props,
68956895
for (int i = 0; i < ndraid; i++)
68966896
spa_feature_incr(spa, SPA_FEATURE_DRAID, tx);
68976897

6898+
if (!spa_feature_is_enabled(spa, SPA_FEATURE_DRAID_FAIL_DOMAINS) &&
6899+
draid_nfgroup > 0)
6900+
return (SET_ERROR(ENOTSUP));
6901+
68986902
for (int i = 0; i < draid_nfgroup; i++)
68996903
spa_feature_incr(spa, SPA_FEATURE_DRAID_FAIL_DOMAINS, tx);
69006904

@@ -7643,6 +7647,10 @@ spa_vdev_add(spa_t *spa, nvlist_t *nvroot, boolean_t check_ashift)
76437647
dsl_sync_task_nowait(spa->spa_dsl_pool, spa_draid_feature_incr,
76447648
(void *)(uintptr_t)ndraid, tx);
76457649

7650+
if (!spa_feature_is_enabled(spa,
7651+
SPA_FEATURE_DRAID_FAIL_DOMAINS) && draid_nfgroup > 0)
7652+
return (spa_vdev_exit(spa, vd, txg, ENOTSUP));
7653+
76467654
if (draid_nfgroup > 0)
76477655
dsl_sync_task_nowait(spa->spa_dsl_pool,
76487656
spa_draid_fdomains_feature_incr,

module/zfs/vdev.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -903,14 +903,6 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvlist_t *nv, vdev_t *parent, uint_t id,
903903
!spa_feature_is_enabled(spa, SPA_FEATURE_DRAID)) {
904904
return (SET_ERROR(ENOTSUP));
905905
}
906-
907-
/* spa_vdev_add() expects feature to be enabled */
908-
if (ops == &vdev_draid_ops &&
909-
spa->spa_load_state != SPA_LOAD_CREATE &&
910-
!spa_feature_is_enabled(spa,
911-
SPA_FEATURE_DRAID_FAIL_DOMAINS))
912-
return (SET_ERROR(ENOTSUP));
913-
914906
}
915907

916908
/*

0 commit comments

Comments
 (0)