summaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev.c
diff options
context:
space:
mode:
authorGeLiXin <[email protected]>2016-08-09 17:49:51 +0800
committerNed Bass <[email protected]>2016-09-09 13:21:09 -0700
commitc23686524f68fc8594610060fff65c747b1e8eda (patch)
treebe279f273f3f96b32c3db181fe99f79151bf2f2d /module/zfs/vdev.c
parent74acdfc6827385a7b576c67e494bf40dc3f80db7 (diff)
Fix incorrect pool state after import
Import a raidz pool which has a vdev with a bad label, zpool status shows the right state of the dev, but the wrong state of the pool. The pool state should be DEGRADED, not ONLINE. We examine the label in vdev_validate while in spa_load_impl, the bad label can be detected but doesn't propagate its state to the parent. There are other chances to propagate state in the following vdev_load if we failed to load DTL, but our pool is raidz1 which can tolerate a faulted disk. So we lost the last chance to correct the pool state. Propagate the leaf vdev's state to parent if its label was corrupted, as is done elsewhere in vdev_validate. Signed-off-by: GeLiXin <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #4948
Diffstat (limited to 'module/zfs/vdev.c')
-rw-r--r--module/zfs/vdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c
index dffc621d1..235ed381c 100644
--- a/module/zfs/vdev.c
+++ b/module/zfs/vdev.c
@@ -1407,7 +1407,7 @@ vdev_validate(vdev_t *vd, boolean_t strict)
spa_last_synced_txg(spa) : -1ULL;
if ((label = vdev_label_read_config(vd, txg)) == NULL) {
- vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN,
+ vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN,
VDEV_AUX_BAD_LABEL);
return (0);
}