[Devel] [PATCH hci-8.1 v2 0/3] dm-qcow2: keep images of a read-only table unmodified

Konstantin Khorenko khorenko at virtuozzo.com
Tue Nov 3 19:30:57 MSK 2026


Applying the series with these fixes on my side:

- Reviewed-by: Andrey Zhadchenko on all three patches, from the v1
  thread.
- patch 3: "requires to treat" -> "requires treating".

On 10/29/26 15:43, Alexander Ivanov wrote:
> A read-only dm-qcow2 table does not protect its images. Writes to the
> device pass through bio_check_ro() with a warning and allocate clusters
> in the top image, the unaligned tail of an O_RDWR top image is padded
> on .ctr and .preresume, and merge_backward modifies the lower image.

- Please create one more task, like VSTOR-152393..152395, and fix it
  separately: a data read of a read-only image with an unaligned tail
  never completes.

md_page_read_complete() zero-fills a short read near EOF, so metadata
pages are fine. data_rw_complete() is not: it advances past the short
read and resubmits, the next read starts at EOF and returns 0,
WARN_ON_ONCE() fires and the qio is resubmitted without progress. This
is old for O_RDONLY images and now also covers an O_RDWR image on a
read-only table, which patch 1 stops padding. qemu never leaves such a
tail, so it takes an externally truncated image. The fix is a zero fill
in data_rw_complete() like the metadata one.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list