summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2013-10-10 09:53:46 +0000
committeravg <avg@FreeBSD.org>2013-10-10 09:53:46 +0000
commit1446c5336b3260259fee588aee965913921f665e (patch)
treec6003d7e1d6f5b2328be0992fd273891bbf8dcdf /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
parent7e16281655cc6db7075bf9d7e5c539f009307ebb (diff)
downloadFreeBSD-src-1446c5336b3260259fee588aee965913921f665e.zip
FreeBSD-src-1446c5336b3260259fee588aee965913921f665e.tar.gz
MFV r255257: 4082 zfs receive gets EFBIG from dmu_tx_hold_free()
illumos change 14172:be36a38bac3d: illumos ZFS issues: 4082 zfs receive gets EFBIG from dmu_tx_hold_free() Please note that this change is slightly different from r255257, because it is merged out of order with other (larger) upstream changes. PR: kern/182570 Reported by: Keith White <kwhite@site.uottawa.ca> Tested by: Keith White <kwhite@site.uottawa.ca> Approved by: re (glebius) MFC after: 1 week X-MFC after: r254753
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.c10
1 files changed, 10 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 9e661be..a17eea9 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
@@ -677,6 +677,16 @@ dmu_free_long_range(objset_t *os, uint64_t object,
if (err != 0)
return (err);
err = dmu_free_long_range_impl(os, dn, offset, length);
+
+ /*
+ * It is important to zero out the maxblkid when freeing the entire
+ * file, so that (a) subsequent calls to dmu_free_long_range_impl()
+ * will take the fast path, and (b) dnode_reallocate() can verify
+ * that the entire file has been freed.
+ */
+ if (offset == 0 && length == DMU_OBJECT_END)
+ dn->dn_maxblkid = 0;
+
dnode_rele(dn, FTAG);
return (err);
}
OpenPOWER on IntegriCloud