summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2012-09-05 12:02:09 +0000
committermm <mm@FreeBSD.org>2012-09-05 12:02:09 +0000
commit3a59a28395e506fbec113160179d4c50fe9b3c25 (patch)
tree9cb7bfc2b298035a5e16527a5e95add3afffa44a /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
parentdfb185f5592710a31d133dc2ce652110587f6c1e (diff)
downloadFreeBSD-src-3a59a28395e506fbec113160179d4c50fe9b3c25.zip
FreeBSD-src-3a59a28395e506fbec113160179d4c50fe9b3c25.tar.gz
Merge recent vendor changes and sync code:
1862 incremental zfs receive fails for sparse file > 8PB 3112 ztest does not honor ZFS_DEBUG 3122 zfs destroy filesystem should prefetch blocks 3129 'zpool reopen' restarts resilvers 3130 ztest failure: Assertion failed: 0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10) References: https://www.illumos.org/issues/1862 https://www.illumos.org/issues/3112 https://www.illumos.org/issues/3122 https://www.illumos.org/issues/3129 https://www.illumos.org/issues/3130 Obtained from: illumos (vendor/illumos, vendor/illumos-sys) MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
index 43650f3..6396e1c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
@@ -462,12 +462,14 @@ dsl_dir_destroy_check(void *arg1, void *arg2, dmu_tx_t *tx)
/*
* There should be exactly two holds, both from
* dsl_dataset_destroy: one on the dd directory, and one on its
- * head ds. Otherwise, someone is trying to lookup something
- * inside this dir while we want to destroy it. The
- * config_rwlock ensures that nobody else opens it after we
- * check.
+ * head ds. If there are more holds, then a concurrent thread is
+ * performing a lookup inside this dir while we're trying to destroy
+ * it. To minimize this possibility, we perform this check only
+ * in syncing context and fail the operation if we encounter
+ * additional holds. The dp_config_rwlock ensures that nobody else
+ * opens it after we check.
*/
- if (dmu_buf_refcount(dd->dd_dbuf) > 2)
+ if (dmu_tx_is_syncing(tx) && dmu_buf_refcount(dd->dd_dbuf) > 2)
return (EBUSY);
err = zap_count(mos, dd->dd_phys->dd_child_dir_zapobj, &count);
OpenPOWER on IntegriCloud