diff options
author | Brian Behlendorf <[email protected]> | 2015-03-20 15:10:24 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-03-25 14:52:52 -0700 |
commit | 7d90f569b3f05def7cbd0a52ce8ac3040364d702 (patch) | |
tree | a1762d37a003105fae3c547b1d0272c8aca4526a /cmd/zpool | |
parent | 58806b4cdc32e6f4e4a214cfba3b62a24efb34b7 (diff) |
Check all vdev labels in 'zpool import'
When using 'zpool import' to scan for available pools prefer vdev names
which reference vdevs with more valid labels. There should be two labels
at the start of the device and two labels at the end of the device. If
labels are missing then the device has been damaged or is in some other
way incomplete. Preferring names with fully intact labels helps weed out
bad paths and improves the likelihood of being able to import the pool.
This behavior only applies when scanning /dev/ for valid pools. If a
cache file exists the pools described by the cache file will be used.
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Chris Dunlap <[email protected]>
Closes #3145
Closes #2844
Closes #3107
Diffstat (limited to 'cmd/zpool')
-rw-r--r-- | cmd/zpool/zpool_vdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index 93a968dba..cf6d2bfa5 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -597,7 +597,7 @@ is_spare(nvlist_t *config, const char *path) if (zpool_in_use(g_zfs, fd, &state, &name, &inuse) != 0 || !inuse || state != POOL_STATE_SPARE || - zpool_read_label(fd, &label) != 0) { + zpool_read_label(fd, &label, NULL) != 0) { free(name); (void) close(fd); return (B_FALSE); |