summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-07-23 00:35:06 +0000
committerdelphij <delphij@FreeBSD.org>2014-07-23 00:35:06 +0000
commitffc18ded5bc79502d527f9ff35220d2a5e579225 (patch)
treebf62623a34aeeb725ec83c3dca937146ba6420fa /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
parentdc97077d62c55c6f91988f073e9e645c3eb7a5ee (diff)
downloadFreeBSD-src-ffc18ded5bc79502d527f9ff35220d2a5e579225.zip
FreeBSD-src-ffc18ded5bc79502d527f9ff35220d2a5e579225.tar.gz
MFC r268464: MFV r268452:
Explicitly mark file removal transactions as "presumed to result in a net free of space" so they will not fail with ENOSPC. Illumos issue: 4950 files sometimes can't be removed from a full filesystem
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
index d82f134..a073068 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
@@ -673,6 +673,12 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset,
dmu_tx_t *tx = dmu_tx_create(os);
dmu_tx_hold_free(tx, dn->dn_object,
chunk_begin, chunk_end - chunk_begin);
+
+ /*
+ * Mark this transaction as typically resulting in a net
+ * reduction in space used.
+ */
+ dmu_tx_mark_netfree(tx);
err = dmu_tx_assign(tx, TXG_WAIT);
if (err) {
dmu_tx_abort(tx);
@@ -724,6 +730,7 @@ dmu_free_long_object(objset_t *os, uint64_t object)
tx = dmu_tx_create(os);
dmu_tx_hold_bonus(tx, object);
dmu_tx_hold_free(tx, object, 0, DMU_OBJECT_END);
+ dmu_tx_mark_netfree(tx);
err = dmu_tx_assign(tx, TXG_WAIT);
if (err == 0) {
err = dmu_object_free(os, object, tx);
OpenPOWER on IntegriCloud