Revert "Fix incorrect expected error in ztest" #17503
Open
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Revisiting #15295. A recent example of this failure in the CI can be found here:
https://github.com/openzfs/zfs/actions/runs/16007042925/attempts/3?pr=17501
Description
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().
How Has This Been Tested?
Locally tested. During that testing I noticed a slightly different case which may explain the confusion here. During one run somehow ztest ended up adding a distributed spare for a top-level dRAID device which doesn't exist. In this case, EINVAL was returned instead ENOTSUP, however it should be impossible to manipulate a pool in to this layout. I wasn't able to manually reproduce the issue, so more debugging will be needed. That can be handled in a different PR.
Simplified example invalid pool config observed by ztest. Attaching
draid1-1-0
will correctly returnEINVAL
, thedraid1-1-0
distributed spare should not exist.Types of changes
Checklist:
Signed-off-by
.