svn commit: r298072 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Alan Somers
asomers at FreeBSD.org
Fri Apr 15 16:36:18 UTC 2016
Author: asomers
Date: Fri Apr 15 16:36:17 2016
New Revision: 298072
URL: https://svnweb.freebsd.org/changeset/base/298072
Log:
Don't corrupt ZFS label's physpath attribute when booting while a disk is missing
Prior to this change, vdev_geom_open_by_path would call vdev_geom_attach
prior to verifying the device's GUIDs. vdev_geom_attach calls
vdev_geom_attrchange to set the physpath in the vdev object. The result is
that if the disk could not be found, then the labels for other disks in the
same TLD would overwrite the missing disk's physpath with the physpath of
whichever disk currently has the same devname as the missing one used to
have.
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Modified:
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Apr 15 16:21:13 2016 (r298071)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Apr 15 16:36:17 2016 (r298072)
@@ -246,9 +246,6 @@ vdev_geom_attach(struct g_provider *pp,
cp->private = vd;
vd->vdev_tsd = cp;
- /* Fetch initial physical path information for this device. */
- vdev_geom_attrchanged(cp, "GEOM::physpath");
-
cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
return (cp);
}
@@ -805,6 +802,10 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
}
}
+ /* Fetch initial physical path information for this device. */
+ if (cp != NULL)
+ vdev_geom_attrchanged(cp, "GEOM::physpath");
+
g_topology_unlock();
PICKUP_GIANT();
if (cp == NULL) {
More information about the svn-src-head
mailing list