aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dnode.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2016-10-31 10:42:37 -0700
committerBrian Behlendorf <[email protected]>2018-07-30 09:28:09 -0700
commit1897bc0d4843e8774189bd7e37a2d6b025dd94cc (patch)
tree5590d2cc82cda17e19e2431f8d645d40d6740bd1 /module/zfs/dnode.c
parent21d48b5eac54ba7b2e4d8bf0d0e747082e0e8577 (diff)
OpenZFS 9439 - ZFS double-free due to failure to dirty indirect block
Follow up commit for OpenZFS 9438. See the OpenZFS-issue link below for a complete analysis. Authored by: Matthew Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://illumos.org/issues/9439 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/779220d External-issue: DLPX-46861 Closes #7746
Diffstat (limited to 'module/zfs/dnode.c')
-rw-r--r--module/zfs/dnode.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
index 0be72e90a..26471fda0 100644
--- a/module/zfs/dnode.c
+++ b/module/zfs/dnode.c
@@ -1987,13 +1987,11 @@ dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx)
if (off == 0 && len >= blksz) {
/*
* Freeing the whole block; fast-track this request.
- * Note that we won't dirty any indirect blocks,
- * which is fine because we will be freeing the entire
- * file and thus all indirect blocks will be freed
- * by free_children().
*/
blkid = 0;
nblks = 1;
+ if (dn->dn_nlevels > 1)
+ dnode_dirty_l1(dn, 0, tx);
goto done;
} else if (off >= blksz) {
/* Freeing past end-of-data */