[Devel] [PATCH hci-8.2] dm-ploop: fix a double fput of the delta file when ploop_add_delta() fails

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Thu Nov 19 04:12:49 MSK 2026


> From: Denis V. Lunev <den at openvz.org>
> 
> ploop_add_delta() stores the file in deltas[level].file before it
> allocates mtfile and clones the file for the runners. If kcalloc() or
> file_clone_open() fails, the file stays there: ploop_add_deltas_stack()
> puts it at err_fput, and ploop_destroy() puts it again from the failed
> ctr, because nr_deltas already covers the slot. The second fput() drops
> a reference the target does not own, and the last close of the fd then
> finds a freed file: "VFS: Close: file count is 0", a BUG with
> CONFIG_BUG_ON_DATA_CORRUPTION.
> 
> Store the file only after the clones are made. ploop_destroy() still
> puts the clones made before the failure.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-155723
> 
> Fixes: 762b90ec3324 ("dm-ploop: use filp per thread")
> Feature: dm-ploop: ploop target driver
> Signed-off-by: Denis V. Lunev <den at openvz.org>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261119010758.4106250-1-den@openvz.org?part=1




More information about the Devel mailing list