svn commit: r308592 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Alexander Motin mav at FreeBSD.org
Sat Nov 12 23:40:41 UTC 2016


Author: mav
Date: Sat Nov 12 23:40:40 2016
New Revision: 308592
URL: https://svnweb.freebsd.org/changeset/base/308592

Log:
  MFC r308055: Add vdev_reopening support to vdev_geom.
  
  It allows to avoid extra GEOM providers flapping without significant need.
  Since GEOM got resize support, we don't need to reopen provider to get new
  size.  If provider was orphaned and no longer valid, ZFS should already
  know that, and in such case reopen should be done in full as expected.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Sat Nov 12 23:39:08 2016	(r308591)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Sat Nov 12 23:40:40 2016	(r308592)
@@ -778,7 +778,14 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
 		return (EINVAL);
 	}
 
-	vd->vdev_tsd = NULL;
+	/*
+	 * Reopen the device if it's not currently open. Otherwise,
+	 * just update the physical size of the device.
+	 */
+	if ((cp = vd->vdev_tsd) != NULL) {
+		ASSERT(vd->vdev_reopening);
+		goto skip_open;
+	}
 
 	DROP_GIANT();
 	g_topology_lock();
@@ -863,6 +870,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
 		vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED;
 		return (error);
 	}
+skip_open:
 	pp = cp->provider;
 
 	/*
@@ -898,6 +906,9 @@ static void
 vdev_geom_close(vdev_t *vd)
 {
 
+	if (vd->vdev_reopening)
+		return;
+
 	DROP_GIANT();
 	g_topology_lock();
 	vdev_geom_close_locked(vd);


More information about the svn-src-all mailing list