Skip to content

Commit

Permalink
6386 Fix function call with uninitialized value in vdev_inuse
Browse files Browse the repository at this point in the history
Reviewed by: Brian Behlendorf <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Dan Kimmel <[email protected]>
Approved by: Robert Mustacchi <[email protected]>
  • Loading branch information
ryao authored and ahrens committed Oct 31, 2015
1 parent dd32933 commit 5bdd995
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion usr/src/uts/common/fs/zfs/vdev_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,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;

Expand Down

0 comments on commit 5bdd995

Please sign in to comment.