Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Sep 2017 06:04:50 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323481 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201709120604.v8C64opD052642@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Sep 12 06:04:50 2017
New Revision: 323481
URL: https://svnweb.freebsd.org/changeset/base/323481

Log:
  zfsvfs_hold: assert that the busied filesystem can not be unmounted
  
  This is a FreeBSD specific feature.
  
  MFC after:	3 weeks
  Sponsored by:	Panzura

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Tue Sep 12 06:04:01 2017	(r323480)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Tue Sep 12 06:04:50 2017	(r323481)
@@ -1488,6 +1488,7 @@ zfsvfs_hold(const char *name, void *tag, zfsvfs_t **zf
 	if (error == 0) {
 		rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER :
 		    RW_READER, tag);
+#ifdef illumos
 		if ((*zfvp)->z_unmounted) {
 			/*
 			 * XXX we could probably try again, since the unmounting
@@ -1497,6 +1498,13 @@ zfsvfs_hold(const char *name, void *tag, zfsvfs_t **zf
 			rrm_exit(&(*zfvp)->z_teardown_lock, tag);
 			return (SET_ERROR(EBUSY));
 		}
+#else
+		/*
+		 * vfs_busy() ensures that the filesystem is not and
+		 * can not be unmounted.
+		 */
+		ASSERT(!(*zfvp)->z_unmounted);
+#endif
 	}
 	return (error);
 }



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