[Devel] [PATCH hci-8.1 v2 1/4] dm-ploop: fix freeing the wrong clusters when a BAT writeback fails

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Wed Oct 28 18:00:27 MSK 2026


> From: Denis V. Lunev <den at openvz.org>
> 
> When an index writeback fails, ploop_advance_local_after_bat_wb()
> gives the clusters it allocated back to holes_bitmap. It passes
> i + off, the virtual cluster number, to ploop_hole_set_bit(). Since
> "dm-ploop: make new allocations immediately visible in BAT" it does
> so for every mapped entry of the page, including the ones copied from
> the local BAT that this writeback did not change.
> 
> This marks as free image clusters that are still in use: data
> clusters of other virtual clusters, and also the clusters holding the
> header and the BAT, since small virtual cluster numbers fall there.
> Later allocations hand them out again, so a guest write can land on
> live data or on the BAT, while the clusters really allocated for the
> failed writeback stay leaked.
> 
> Free the image cluster the entry points to, and only for entries this
> writeback changed: those differing from the local BAT, and those the
> local BAT maps from a lower delta, which a COW replaced.
> 
> Fixes: 6ddad5a4d226 ("dm-ploop: Add ploop target driver")
> https://virtuozzo.atlassian.net/browse/VSTOR-151979
> 
> Signed-off-by: Denis V. Lunev <den at openvz.org>

Sashiko has reviewed this patch and found no issues. It looks great!

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




More information about the Devel mailing list