Skip to content

Commit 69b8a25

Browse files
committed
Revert "Fix incorrect expected error in ztest"
This reverts commit 2076011. The comment which explains EINVAL should be expected for this case was wrong, not the code. The kernel will return ENOTSUP when attaching a distributed spare to the wrong top-level dRAID vdev. See the check for this in spa_vdev_attach(). Signed-off-by: Brian Behlendorf <[email protected]>
1 parent eacf618 commit 69b8a25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/ztest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,7 +3882,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
38823882
* If newvd is too small, it should fail with EOVERFLOW.
38833883
*
38843884
* If newvd is a distributed spare and it's being attached to a
3885-
* dRAID which is not its parent it should fail with EINVAL.
3885+
* dRAID which is not its parent it should fail with ENOTSUP.
38863886
*/
38873887
if (pvd->vdev_ops != &vdev_mirror_ops &&
38883888
pvd->vdev_ops != &vdev_root_ops && (!replacing ||
@@ -3901,7 +3901,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
39013901
else if (ashift > oldvd->vdev_top->vdev_ashift)
39023902
expected_error = EDOM;
39033903
else if (newvd_is_dspare && pvd != vdev_draid_spare_get_parent(newvd))
3904-
expected_error = EINVAL;
3904+
expected_error = ENOTSUP;
39053905
else
39063906
expected_error = 0;
39073907

0 commit comments

Comments
 (0)