diff options
author | Lin Ling <Lin.Ling@Sun.COM> | 2008-09-24 20:56:23 -0700 |
---|---|---|
committer | Lin Ling <Lin.Ling@Sun.COM> | 2008-09-24 20:56:23 -0700 |
commit | f4565e39fe75b2c28258c16bc697741760935002 (patch) | |
tree | 2335343b20dc557306d8b3d8d1f9004fbe8282de /usr/src | |
parent | 1cb84fbf006414a451b65e461cfdb78736884f53 (diff) | |
download | illumos-joyent-f4565e39fe75b2c28258c16bc697741760935002.tar.gz |
6750475 can't boot off a mirrored root with a failed disk
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/fs/zfs/spa.c | 5 | ||||
-rw-r--r-- | usr/src/uts/common/fs/zfs/vdev_disk.c | 9 |
2 files changed, 6 insertions, 8 deletions
diff --git a/usr/src/uts/common/fs/zfs/spa.c b/usr/src/uts/common/fs/zfs/spa.c index 991e4052d9..9e80f371e7 100644 --- a/usr/src/uts/common/fs/zfs/spa.c +++ b/usr/src/uts/common/fs/zfs/spa.c @@ -2344,9 +2344,8 @@ spa_get_rootconf(char *devpath, char *devid, nvlist_t **bestconf) if (nvlist_lookup_string(child[c], ZPOOL_CONFIG_DEVID, &cdevid) != 0) return (EINVAL); - if (error = spa_check_rootconf(cpath, cdevid, NULL, &tmptxg)) - return (error); - if (tmptxg > txg) { + if ((spa_check_rootconf(cpath, cdevid, NULL, + &tmptxg) == 0) && (tmptxg > txg)) { txg = tmptxg; VERIFY(nvlist_lookup_string(child[c], ZPOOL_CONFIG_PATH, &bootpath) == 0); diff --git a/usr/src/uts/common/fs/zfs/vdev_disk.c b/usr/src/uts/common/fs/zfs/vdev_disk.c index fe4e97524e..2c6ea543ad 100644 --- a/usr/src/uts/common/fs/zfs/vdev_disk.c +++ b/usr/src/uts/common/fs/zfs/vdev_disk.c @@ -608,15 +608,13 @@ vdev_disk_read_rootlabel(char *devpath, char *devid, nvlist_t **config) uint64_t s, size; int l; ddi_devid_t tmpdevid; - int error; + int error = -1; char *minor_name; /* * Read the device label and build the nvlist. */ - error = ldi_open_by_name(devpath, FREAD, kcred, &vd_lh, zfs_li); - - if (error && devid != NULL && ddi_devid_str_decode(devid, &tmpdevid, + if (devid != NULL && ddi_devid_str_decode(devid, &tmpdevid, &minor_name) == 0) { error = ldi_open_by_devid(tmpdevid, minor_name, spa_mode, kcred, &vd_lh, zfs_li); @@ -624,7 +622,8 @@ vdev_disk_read_rootlabel(char *devpath, char *devid, nvlist_t **config) ddi_devid_str_free(minor_name); } - if (error) + if (error && (error = ldi_open_by_name(devpath, FREAD, kcred, &vd_lh, + zfs_li))) return (error); if (ldi_get_size(vd_lh, &s)) { |