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
This commit is contained in:
parent
7a6aeaa6d9
commit
59f25153db
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user