diff options
author | avg <avg@FreeBSD.org> | 2012-10-26 14:50:16 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2012-10-26 14:50:16 +0000 |
commit | 59f25153db33b7d4d623ce5b1a9ada05af30976f (patch) | |
tree | 3fd1295969fe117b9b099a691daeeca7000f28e9 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c | |
parent | 7a6aeaa6d9f814fc0bf3431c5cb15f21de71832a (diff) | |
download | FreeBSD-src-59f25153db33b7d4d623ce5b1a9ada05af30976f.zip FreeBSD-src-59f25153db33b7d4d623ce5b1a9ada05af30976f.tar.gz |
zfs: fix label validation code in vdev_geom_read_config
POOL_STATE_SPARE and POOL_STATE_L2CACHE were not handled correctly
and thus the cache and spare disks would not be correctly probed.
Reported by: Michael Schmiedgen <schmiedgen@gmx.net>,
Matthew D. Fuller <fullermd@over-yonder.net>
Tested by: Michael Schmiedgen <schmiedgen@gmx.net>,
flo
MFC after: 5 days
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c index 609205f..60dbe68 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c @@ -270,14 +270,16 @@ vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) continue; if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE, - &state) != 0 || state >= POOL_STATE_DESTROYED) { + &state) != 0 || state == POOL_STATE_DESTROYED || + state > POOL_STATE_L2CACHE) { nvlist_free(*config); *config = NULL; continue; } - if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG, - &txg) != 0 || txg == 0) { + if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE && + (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG, + &txg) != 0 || txg == 0)) { nvlist_free(*config); *config = NULL; continue; |