summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-08-06 14:23:33 +0000
committermav <mav@FreeBSD.org>2013-08-06 14:23:33 +0000
commit12049ee5d5885aabb6f2ef194498779fa2135e59 (patch)
treefcb713a02bd244ff1afff78bbd468f1491bc1e5d /sys/cddl
parent07b58a38cf6664708546a9f4cd18fb8cc3a3bb1f (diff)
downloadFreeBSD-src-12049ee5d5885aabb6f2ef194498779fa2135e59.zip
FreeBSD-src-12049ee5d5885aabb6f2ef194498779fa2135e59.tar.gz
Make `zpool clear` to reopen also reconnected cache and spare devices.
Since `zpool status` reports about such kinds of errors, it is strange that they are not cleared by `zpool clear`.
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
index b7b6ef8..f4d5683 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
@@ -2383,6 +2383,14 @@ vdev_clear(spa_t *spa, vdev_t *vd)
for (int c = 0; c < vd->vdev_children; c++)
vdev_clear(spa, vd->vdev_child[c]);
+ if (vd == rvd) {
+ for (int c = 0; c < spa->spa_l2cache.sav_count; c++)
+ vdev_clear(spa, spa->spa_l2cache.sav_vdevs[c]);
+
+ for (int c = 0; c < spa->spa_spares.sav_count; c++)
+ vdev_clear(spa, spa->spa_spares.sav_vdevs[c]);
+ }
+
/*
* If we're in the FAULTED state or have experienced failed I/O, then
* clear the persistent state and attempt to reopen the device. We
OpenPOWER on IntegriCloud