[Devel] [PATCH hci-8.1 v9 10/10] dm-qcow2: truncate unused tail of image on suspend

Alexander Ivanov alexander.ivanov at virtuozzo.com
Mon Nov 9 13:29:00 MSK 2026


Done.

On 11/3/26 18:50, Konstantin Khorenko wrote:
> I won't apply this version, please send v10 with the changes below.
>
> On 10/28/26 16:06, Alexander Ivanov wrote:
>> inconsistent. Userspace checks the image before opening it RW, which
>> find_unused_cluster() already relies on when it reuses clusters with
>> zero refcount.
> - Drop the find_unused_cluster() argument, and say plainly that in
>    the default mode the scan is safe only because userspace checks the
>    image before an RW open.
> - Say that v2 images are covered only by that check too.
> - Split the paragraphs longer than four sentences.
>
> The allocator reuses a wrongly free cluster only on an allocating
> write, and it takes the lowest free cluster first, so it reaches the
> tail last. The scan reads the tail on every RW suspend. After a crash
> the stale refcounts are exactly at the tail, because L2 goes out with
> the request and refblocks wait for the slow writeback. So the two do
> not carry the same risk.
>
> A v2 image has no dirty bit, so the opened_dirty guard never applies
> to it.
>


More information about the Devel mailing list