Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Sep 2009 08:54:15 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r196965 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <200909080854.n888sFGR041201@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Tue Sep  8 08:54:15 2009
New Revision: 196965
URL: http://svn.freebsd.org/changeset/base/196965

Log:
  Fix reference count leak for a case where snapshot's mount point is updated.
  Such situation is not supported.
  
  This problem was triggered by something like this:
  
  	# zpool create tank da0
  	# zfs snapshot tank@snap
  	# cd /tank/.zfs/snapshot/snap  (this will mount the snapshot)
  	# cd
  	# mount -u nosuid /tank/.zfs/snapshot/snap  (refcount leak)
  	# zpool export tank
  	cannot export 'tank': pool is busy
  
  MFC after:	1 week

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Tue Sep  8 05:46:38 2009	(r196964)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Tue Sep  8 08:54:15 2009	(r196965)
@@ -337,6 +337,13 @@ zfs_register_callbacks(vfs_t *vfsp)
 	os = zfsvfs->z_os;
 
 	/*
+	 * This function can be called for a snapshot when we update snapshot's
+	 * mount point, which isn't really supported.
+	 */
+	if (dmu_objset_is_snapshot(os))
+		return (EOPNOTSUPP);
+
+	/*
 	 * The act of registering our callbacks will destroy any mount
 	 * options we may have.  In order to enable temporary overrides
 	 * of mount options, we stash away the current values and



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