zfsonlinux/zfs — pull request #1864 by behlendorf (2013-11-13 22:54:47+00:00)
Title: Don't validate cache/spares for readonly pools

When a pool is imported read-only avoid validating any hot spare
and l2arc vdevs. The validation process can result in the vdev
being reinitialized and a new label being written. Since the pool
must never be written to the unexpected write IO correctly triggers
a VERIFY in the IO pipeline.

zpool import -o readonly
...
VERIFY(zio->io_type != ZIO_TYPE_WRITE || spa_writeable(spa)) failed
SPLError: 9415:0:(zio.c:2613:zio_vdev_io_start()) SPL PANIC

Signed-off-by: Brian Behlendorf
Issue #1863