--- 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);