]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Illumos #4121 vdev_label_init read only
authorGeorge Wilson <george.wilson@delphix.com>
Thu, 12 Dec 2013 18:19:54 +0000 (10:19 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 12 Dec 2013 18:24:01 +0000 (10:24 -0800)
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@973c78e94bf9634782164382c9e291bf81161fa5

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1863

module/zfs/vdev_label.c

index 146dc28e82c7eb8278513cc563c752c850c24703..568ae06b343ae9e9e0a32bbb482484a1e4f6523e 100644 (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 */
        vd->vdev_crtxg = crtxg;
 
-       if (!vd->vdev_ops->vdev_op_leaf)
+       if (!vd->vdev_ops->vdev_op_leaf || !spa_writeable(spa))
                return (0);
 
        /*