mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
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 <mahrens@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> OpenZFS-issue: https://illumos.org/issues/9439 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/779220d External-issue: DLPX-46861 Closes #7746
This commit is contained in:
committed by
Brian Behlendorf
parent
21d48b5eac
commit
1897bc0d48
+2
-4
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user