diff --git a/module/zfs/dsl_dir.c b/module/zfs/dsl_dir.c index 885b716034fc..6e770affbda9 100644 --- a/module/zfs/dsl_dir.c +++ b/module/zfs/dsl_dir.c @@ -2309,9 +2309,11 @@ dsl_dir_activity_in_progress(dsl_dir_t *dd, dsl_dataset_t *ds, if (error != 0) break; + mutex_enter(&os->os_user_ptr_lock); + void *user = dmu_objset_get_user(os); + mutex_exit(&os->os_user_ptr_lock); if (dmu_objset_type(os) != DMU_OST_ZFS || - dmu_objset_get_user(os) == NULL || - zfs_get_vfs_flag_unmounted(os)) { + user == NULL || zfs_get_vfs_flag_unmounted(os)) { *in_progress = B_FALSE; return (0); } diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 53820bd8aa9d..995853560f46 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -4132,7 +4132,6 @@ zfs_ioc_wait_fs(const char *name, nvlist_t *innvl, nvlist_t *outnvl) mutex_exit(&dd->dd_activity_lock); dsl_dataset_rele(ds, FTAG); - dsl_dir_rele(dd, FTAG); if (error == 0) fnvlist_add_boolean_value(outnvl, ZFS_WAIT_WAITED, waited);