summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-06-18 16:59:39 +0300
committerToomas Soome <tsoome@me.com>2019-08-20 20:14:05 +0300
commit21c878fe36c0151617d2f009615f5d18fddb207e (patch)
tree61ddeda8345cc25b8a0251559f1f6f3a7808d304 /usr/src
parent6af23589e78469fc9f90db8558854d1a822aaa72 (diff)
downloadillumos-joyent-21c878fe36c0151617d2f009615f5d18fddb207e.tar.gz
11559 zfs: device removal should not block bootability
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/fs/zfs/vdev.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c
index 3bf145a4ac..2c84c0cd5b 100644
--- a/usr/src/uts/common/fs/zfs/vdev.c
+++ b/usr/src/uts/common/fs/zfs/vdev.c
@@ -4230,9 +4230,21 @@ vdev_is_bootable(vdev_t *vd)
if (strcmp(vdev_type, VDEV_TYPE_ROOT) == 0 &&
vd->vdev_children > 1) {
- return (B_FALSE);
- } else if (strcmp(vdev_type, VDEV_TYPE_MISSING) == 0 ||
- strcmp(vdev_type, VDEV_TYPE_INDIRECT) == 0) {
+ int non_indirect = 0;
+
+ for (int c = 0; c < vd->vdev_children; c++) {
+ vdev_type =
+ vd->vdev_child[c]->vdev_ops->vdev_op_type;
+ if (strcmp(vdev_type, VDEV_TYPE_INDIRECT) != 0)
+ non_indirect++;
+ }
+ /*
+ * non_indirect > 1 means we have more than one
+ * top-level vdev, so we stop here.
+ */
+ if (non_indirect > 1)
+ return (B_FALSE);
+ } else if (strcmp(vdev_type, VDEV_TYPE_MISSING) == 0) {
return (B_FALSE);
}
}