From b3b3cd1e4fdb8b6c0de02a5d66261a52ba6b33a5 Mon Sep 17 00:00:00 2001 From: Ameer Hamza Date: Thu, 29 May 2025 17:47:26 +0500 Subject: [PATCH] vdev: skip faulting disks pending removal This patch fixes a race where vdev_remove_wanted may be set after probe initiation, which could otherwise trigger redundant fault and removal. Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Reviewed-by: Tony Hutter Signed-off-by: Ameer Hamza Closes #17400 --- module/zfs/vdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 4fab60336..63f2f3794 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -1772,8 +1772,11 @@ vdev_probe_done(zio_t *zio) * change the state in a spa_async_request. Probes that * were initiated from a vdev_open can change the state * as part of the open call. + * Skip fault injection if this vdev is already removed + * or a removal is pending. */ - if (vps->vps_zio_done_probe) { + if (vps->vps_zio_done_probe && + !vd->vdev_remove_wanted && !vd->vdev_removed) { vd->vdev_fault_wanted = B_TRUE; spa_async_request(spa, SPA_ASYNC_FAULT_VDEV); }