HomeFreeBSD

Fix incorrect pool state after import

Description

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 <ge.lixin@zte.com.cn>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Don Brady <don.brady@intel.com>
Closes #4948

Details

Provenance
GeLiXin <ge.lixin@zte.com.cn>Authored on Aug 9 2016, 9:49 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Aug 12 2016, 8:46 PM
Parents
rGfb390aafc833: OpenZFS 5997 - FRU field not set during pool creation and never updated
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGe35c5a8265e7: Fix incorrect pool state after import (authored by GeLiXin <ge.lixin@zte.com.cn>).Aug 12 2016, 8:46 PM