path: root/uts/common/fs/zfs/dmu_object.c
diff options
authorAlexander Motin <mav@FreeBSD.org>2018-08-02 23:37:26 +0000
committerAlexander Motin <mav@FreeBSD.org>2018-08-02 23:37:26 +0000
commit1ca9a2427b244ea50644079bb46b464b64932c03 (patch)
tree56b8129ad52e549869d9a048bd6081f84334608f /uts/common/fs/zfs/dmu_object.c
parent3a767198cc4d3f2aa5c3c2662195a39e50b80f77 (diff)
9438 Holes can lose birth time info if a block has a mix of birth times
Ultimately, the problem here is that when you truncate and write a file in the same transaction group, the dbuf for the indirect block will be zeroed out to deal with the truncation, and then written for the write. During this process, we will lose hole birth time information for any holes in the range. In the case where a dnode is being freed, we need to determine whether the block should be converted to a higher-level hole in the zio pipeline, and if so do it when the dnode is being synced out. illumos/illumos-gate@738e2a3ce3b2579222d6855e7fe75b5bcfcddf8d Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Paul Dagnelie <pcd@delphix.com>
Notes: svn path=/vendor-sys/illumos/dist/; revision=337200
Diffstat (limited to 'uts/common/fs/zfs/dmu_object.c')
1 files changed, 4 insertions, 0 deletions
diff --git a/uts/common/fs/zfs/dmu_object.c b/uts/common/fs/zfs/dmu_object.c
index aede315502d9..b853081e8b7c 100644
--- a/uts/common/fs/zfs/dmu_object.c
+++ b/uts/common/fs/zfs/dmu_object.c
@@ -167,6 +167,10 @@ dmu_object_free(objset_t *os, uint64_t object, dmu_tx_t *tx)
return (err);
ASSERT(dn->dn_type != DMU_OT_NONE);
+ /*
+ * If we don't create this free range, we'll leak indirect blocks when
+ * we get to freeing the dnode in syncing context.
+ */
dnode_free_range(dn, 0, DMU_OBJECT_END, tx);
dnode_free(dn, tx);
dnode_rele(dn, FTAG);