usr/src/uts/common/fs/zfs/zfs_vfsops.c
changeset 9788 f660bc44f2e8
parent 9749 105f407a2680
child 10204 83c3a84aecef
--- a/usr/src/uts/common/fs/zfs/zfs_vfsops.c	Thu Jun 04 15:16:57 2009 -0400
+++ b/usr/src/uts/common/fs/zfs/zfs_vfsops.c	Thu Jun 04 13:01:01 2009 -0700
@@ -1037,6 +1037,16 @@
 zfsvfs_free(zfsvfs_t *zfsvfs)
 {
 	int i;
+	extern krwlock_t zfsvfs_lock; /* in zfs_znode.c */
+
+	/*
+	 * This is a barrier to prevent the filesystem from going away in
+	 * zfs_znode_move() until we can safely ensure that the filesystem is
+	 * not unmounted. We consider the filesystem valid before the barrier
+	 * and invalid after the barrier.
+	 */
+	rw_enter(&zfsvfs_lock, RW_READER);
+	rw_exit(&zfsvfs_lock);
 
 	zfs_fuid_destroy(zfsvfs);