[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 21:59:48 MSK 2026
Applying with these fixes on my side:
- patch 1: "The counting is done from the main work only" -> "The
counters are increased from the main work only".
- patch 2: "refer the cluster" -> "refer to the cluster", and the
comma splice "of a page, others wait" -> "of a page; the others
wait".
On Thu, 12 Nov 2026 14:12:02 +0300, Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com> wrote:
> Make such a discard wait for these writes before the cluster is freed:
The code is right: every data write decrements exactly once, also on
error and on a resubmitted short write, and the generation switch
cannot lose the wakeup of the waiting discard.
Separate patches, not needed for this series; I created a task for
it:
1. Reads are not counted. A guest read resolved to the cluster before
the discard locked the index can land after the cluster went to
another LBA or to an L2 or refcount table, and return that content.
It is older than this series (6e1c3e5a91fd). ext4 and xfs close the
window, their hole punch waits for in-flight direct I/O, but
fuse_file_fallocate() does not, so images on vstorage are exposed.
https://virtuozzo.atlassian.net/browse/VSTOR-154939
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list