mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix ddtprune causing space leak
In zio_ddt_free, if a pruned dde is still in ddt, it would do nothing and cause space leak. Reviewed-by: Rob Norris <robn@despairlabs.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Allan Jude <allan@klarasystems.com> Signed-off-by: Chunwei Chen <david.chen@nutanix.com> Closes #17982 Closes #17983
This commit is contained in:
@@ -4157,6 +4157,17 @@ zio_ddt_free(zio_t *zio)
|
||||
ddt_phys_variant_t v = ddt_phys_select(ddt, dde, bp);
|
||||
if (v != DDT_PHYS_NONE)
|
||||
ddt_phys_decref(dde->dde_phys, v);
|
||||
else
|
||||
/*
|
||||
* If the entry was found but the phys was not, then
|
||||
* this block must have been pruned from the dedup
|
||||
* table, and the entry refers to a later version of
|
||||
* this data. Therefore, the caller is trying to delete
|
||||
* the only stored instance of this block, and so we
|
||||
* need to do a normal (not dedup) free. Clear dde so
|
||||
* we fall into the block below.
|
||||
*/
|
||||
dde = NULL;
|
||||
}
|
||||
ddt_exit(ddt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user