Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2012 16:56:35 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r238656 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201207201656.q6KGuZVw017263@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Fri Jul 20 16:56:34 2012
New Revision: 238656
URL: http://svn.freebsd.org/changeset/base/238656

Log:
  Make ZVOL resizing ('zfs set volsize') properly resize the GEOM provider.
  
  Sponsored by:	FreeBSD Foundation

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Fri Jul 20 09:49:50 2012	(r238655)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Fri Jul 20 16:56:34 2012	(r238656)
@@ -177,15 +177,9 @@ zvol_size_changed(zvol_state_t *zv)
 	pp = zv->zv_provider;
 	if (pp == NULL)
 		return;
-	if (zv->zv_volsize == pp->mediasize)
-		return;
-	/*
-	 * Changing provider size is not really supported by GEOM, but it
-	 * should be safe when provider is closed.
-	 */
-	if (zv->zv_total_opens > 0)
-		return;
-	pp->mediasize = zv->zv_volsize;
+	g_topology_lock();
+	g_resize_provider(pp, zv->zv_volsize);
+	g_topology_unlock();
 #endif	/* !sun */
 }
 



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