[Devel] [PATCH hci-8.1 0/3] dm-qcow2: do not free a discarded cluster under in-flight writes
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Nov 12 22:00:05 MSK 2026
On Thu, 12 Nov 2026 14:12:02 +0300, Andrey Zhadchenko wrote:
> dm-qcow2: do not free a discarded cluster under in-flight writes
>
> A discard unmapping a cluster locks its L2 index, so requests coming
> later wait until the discard is finished. But a data write, which has
> resolved the index before it was locked, may still be in flight when
> the discard drops the cluster refcount in process_indexes_end(). If
> the cluster is allocated again before this write lands, the write
> corrupts the data or the metadata of the new owner.
>
> [...]
Applied to branch-rh10-6.12.0-211.52.1.22.x.vz10-ovz, will be released in rh10-6.12.0-211.52.1.22.22.vz10, thanks!
[1/3] dm-qcow2: count in-flight data writes per L2 page
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/b4dbaf6d1a44
[2/3] dm-qcow2: wait for in-flight writes before freeing a discarded cluster
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/93922731fc5d
[3/3] dm-qcow2: let discards of one L2 page wait for in-flight writes together
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/48198d82491a
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list