From a0ad7ca54e7803b31458c78bc755d41d22a6ee78 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Thu, 3 May 2018 18:23:15 -0500 Subject: [PATCH] Clear vdev_faulted Clear vdev_faulted if ZPOOL_CONFIG_AUX_STATE is not set to "external" ZoL supports "zpool export -f" (force fault), which can be combined with "-t" (temporary fault; don't persist across export/import) and causes a MOS configuration to be set with ZPOOL_CONFIG_FAULTED=1 and without ZFS_CONFIG_AUX_STATE set at all. In this case, the previously-offlined vdev should be imported in an on-line state and. Clearing the "vdev_faulted" flag causes the import to treat the device as on-line. Typically, resilver will catch it up based on its DTL. Reviewed-by: Brian Behlendorf Signed-off-by: Tim Chase Closes #7459 --- module/zfs/vdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index ad53c0c89..2a28b1c9d 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -754,6 +754,8 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvlist_t *nv, vdev_t *parent, uint_t id, ZPOOL_CONFIG_AUX_STATE, &aux) == 0 && strcmp(aux, "external") == 0) vd->vdev_label_aux = VDEV_AUX_EXTERNAL; + else + vd->vdev_faulted = 0ULL; } } }