Illumos #3306, #3321
[zfs.git] / module / zfs / zfs_vfsops.c
index ac5c317..620e39b 100644 (file)
@@ -1056,6 +1056,12 @@ zfs_sb_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.
         */
@@ -1182,6 +1188,9 @@ zfs_domount(struct super_block *sb, void *data, int silent)
        sb->s_op = &zpl_super_operations;
        sb->s_xattr = zpl_xattr_handlers;
        sb->s_export_op = &zpl_export_operations;
+#ifdef HAVE_S_D_OP
+       sb->s_d_op = &zpl_dentry_operations;
+#endif /* HAVE_S_D_OP */
 
        /* Set features for file system. */
        zfs_set_fuid_feature(zsb);