[Devel] [PATCH hci-8.1 v3 5/5] dm-ploop: truncate unused tail of top delta on suspend

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Thu Oct 8 17:15:55 MSK 2026


> Preallocated space and clusters at the end of the top delta freed by
> discard are never given back, so the file size never shrinks. Now that
> ploop reloads metadata on resume, we can truncate the top delta on
> suspend: the next resumed ploop (maybe of reloaded table) picks up the
> new file size.
> 
> Add ploop_calc_used_end(), which returns the end of the last cluster
> used by the delta: either BAT area, the last mapped cluster or format
> extension. Metadata is read from disk rather than taken from memory:
> the next table load checks BAT entries against the file size (-EPROTO
> otherwise), while in-memory BAT may differ from on-disk one after
> failed BAT writeback. Skip it if md pages are not clean, as on-disk BAT
> may miss allocated clusters then.
> 
> Userspace writes format extension (CBT) behind the last data cluster
> [ ... ]
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-148171
> Feature: dm-ploop: ploop target driver
> 
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>

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

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261008140333.614909-1-alexander.ivanov@virtuozzo.com?part=5




More information about the Devel mailing list