Illumos #4121 vdev_label_init read only

4121 vdev_label_init should treat request as succeeded when pool
     is read only
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

References:
  https://www.illumos.org/issues/4121
  illumos/illumos-gate@973c78e94b

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1863
This commit is contained in:
George Wilson 2013-12-12 10:19:54 -08:00 committed by Brian Behlendorf
parent 84b0aac5fd
commit dda12da9f1

View File

@ -644,7 +644,7 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason)
/* Track the creation time for this vdev */ /* Track the creation time for this vdev */
vd->vdev_crtxg = crtxg; vd->vdev_crtxg = crtxg;
if (!vd->vdev_ops->vdev_op_leaf) if (!vd->vdev_ops->vdev_op_leaf || !spa_writeable(spa))
return (0); return (0);
/* /*