zed: unclean disk attachment faults the vdev

If the attached disk already contains a vdev GUID, it
means the disk is not clean. In such a scenario, the
physical path would be a match that makes the disk
faulted when trying to online it. So, we would only
want to proceed if either GUID matches with the last
attached disk or the disk is in a clean state.

Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
This commit is contained in:
Ameer Hamza
2022-11-15 05:59:03 +05:00
committed by Brian Behlendorf
parent fbbc375d43
commit 2f2d6bece8
2 changed files with 21 additions and 9 deletions
+2 -2
View File
@@ -4179,9 +4179,9 @@ vdev_clear(spa_t *spa, vdev_t *vd)
vdev_clear(spa, vd->vdev_child[c]);
/*
* It makes no sense to "clear" an indirect vdev.
* It makes no sense to "clear" an indirect or removed vdev.
*/
if (!vdev_is_concrete(vd))
if (!vdev_is_concrete(vd) || vd->vdev_removed)
return;
/*