Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Oct 2016 17:05:14 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308055 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201610281705.u9SH5Etq035972@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Oct 28 17:05:14 2016
New Revision: 308055
URL: https://svnweb.freebsd.org/changeset/base/308055

Log:
  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.
  
  MFC after:	2 weeks

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 Oct 28 16:31:58 2016	(r308054)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Fri Oct 28 17:05:14 2016	(r308055)
@@ -776,7 +776,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();
@@ -861,6 +868,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;
 
 	/*
@@ -896,6 +904,9 @@ static void
 vdev_geom_close(vdev_t *vd)
 {
 
+	if (vd->vdev_reopening)
+		return;
+
 	DROP_GIANT();
 	g_topology_lock();
 	vdev_geom_close_locked(vd);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610281705.u9SH5Etq035972>