[2.2] zpool_vdev_remove() should handle EALREADY error return #15137
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
Backport of #15129 fixes #15013.
Description
When the vdev properties features was merged an extra check was added in
spa_vdev_remove_top_check()
which checked whether the vdev that we want to remove is already being removed and if so return an EALREADY error.Before that change we'd still fail with an error but it was a more generic one - here is the check that failed later in the same function:
Changing the error code returned from that function changed the behavior of the removal's library interface exposed to the userland -
spa_vdev_remove()
now returnsEZFS_UNKNOWN
instead ofEZFS_EBUSY
that was returning before.This patch adds logic to make
spa_vdev_remove()
mindful of the new EALREADY code and propagatingEZFS_EBUSY
reverting to the previously established semantics of that function.How Has This Been Tested?
Tested by CI and original PR author.
Types of changes