MFV r294804: 6386 Fix function call with uninitialized value in vdev_inuse

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Richard Yao <ryao@gentoo.org>

illumos/illumos-gate@5bdd995ddb
This commit is contained in:
mav 2016-01-26 12:50:14 +00:00
parent 291649d74a
commit 40a0b8ba84

View File

@ -602,7 +602,8 @@ vdev_inuse(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason,
* read-only. Instead we look to see if the pools is marked
* read-only in the namespace and set the state to active.
*/
if ((spa = spa_by_guid(pool_guid, device_guid)) != NULL &&
if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE &&
(spa = spa_by_guid(pool_guid, device_guid)) != NULL &&
spa_mode(spa) == FREAD)
state = POOL_STATE_ACTIVE;