From 4d2f7f9839d12708417457cd57cf43d15cae5e92 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Tue, 11 Jun 2024 20:49:10 +1000 Subject: [PATCH] vdev_open: clear async fault flag after reopen After c3f2f1aa2, vdev_fault_wanted is set on a vdev after a probe fails. An end-of-txg async task is charged with actually faulting the vdev. In a single-disk pool, the probe failure will degrade the last disk, and then suspend the pool. However, vdev_fault_wanted is not cleared. After the pool returns, the transaction finishes and the async task runs and faults the vdev, which suspends the pool again. The fix is simple: when reopening a vdev, clear the async fault flag. If the vdev is still failed, the startup probe will quickly notice and degrade/suspend it again. If not, all is well! Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Co-authored-by: Don Brady Signed-off-by: Rob Norris Reviewed-by: Jorgen Lundman Reviewed-by: Tony Hutter Reviewed-by: Don Brady --- module/zfs/vdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index c9ee39b468..224493a86e 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -2008,6 +2008,7 @@ vdev_open(vdev_t *vd) vd->vdev_stat.vs_aux = VDEV_AUX_NONE; vd->vdev_cant_read = B_FALSE; vd->vdev_cant_write = B_FALSE; + vd->vdev_fault_wanted = B_FALSE; vd->vdev_min_asize = vdev_get_min_asize(vd); /*