aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/zfs/vdev_label.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c
index 0780bf601..1c2f00fe2 100644
--- a/module/zfs/vdev_label.c
+++ b/module/zfs/vdev_label.c
@@ -599,7 +599,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;