Tear down and flush the mmap region
[zfs.git] / module / zfs / zfs_vfsops.c
index 8a82d9d..2575638 100644 (file)
@@ -1092,6 +1092,12 @@ zfsvfs_teardown(zfs_sb_t *zsb, boolean_t unmounting)
        }
 
        /*
+        * Drain the iput_taskq to ensure all active references to the
+        * zfs_sb_t have been handled only then can it be safely destroyed.
+        */
+       taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os)));
+
+       /*
         * Close the zil. NB: Can't close the zil while zfs_inactive
         * threads are blocked as zil_close can call zfs_inactive.
         */
@@ -1206,9 +1212,7 @@ zfs_domount(struct super_block *sb, void *data, int silent)
        /* Set callback operations for the file system. */
        sb->s_op = &zpl_super_operations;
        sb->s_xattr = zpl_xattr_handlers;
-#ifdef HAVE_EXPORTS
-        sb->s_export_op = &zpl_export_operations;
-#endif /* HAVE_EXPORTS */
+       sb->s_export_op = &zpl_export_operations;
 
        /* Set features for file system. */
        zfs_set_fuid_feature(zsb);