[Devel] [PATCH hci-8.2 v8 9/9] dm-ploop: truncate unused tail of top delta on suspend
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Wed Nov 18 16:29:25 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 of
> [ ... ]
>
> 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.
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261118131032.3372996-1-alexander.ivanov@virtuozzo.com?part=9
More information about the Devel
mailing list