OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 0/3] dm-qcow2: keep images of a read-only table unmodified
@ 2026-10-23 13:20 Alexander Ivanov
  2026-10-23 13:20 ` [Devel] [PATCH hci-8.1 1/3] drivers/md/dm-qcow2: treat images of a read-only table as read-only Alexander Ivanov
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Alexander Ivanov @ 2026-10-23 13:20 UTC (permalink / raw)
  To: andrey.zhadchenko; +Cc: devel

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, an O_RDWR top image is truncated on .ctr and
.preresume, and merge_backward modifies the lower image. Since the
header is not updated for a read-only table, persistent bitmaps stay
marked consistent while the data under them changes.

Patch 1 makes an image writable only if both its file and the table
are writable. Patch 2 fails writes to a read-only table. Patch 3 keeps
the bitmaps autoclear bit clear if it is already clear in the image,
so that a later writable open does not revalidate stale bitmaps.

https://virtuozzo.atlassian.net/browse/VSTOR-138887

Alexander Ivanov (3):
  drivers/md/dm-qcow2: treat images of a read-only table as read-only
  drivers/md/dm-qcow2: fail writes to a read-only table
  drivers/md/dm-qcow2: do not revalidate inconsistent persistent bitmaps

 drivers/md/dm-qcow2-map.c    |  9 ++++++---
 drivers/md/dm-qcow2-target.c | 11 +++++++----
 drivers/md/dm-qcow2.h        |  3 ++-
 3 files changed, 15 insertions(+), 8 deletions(-)

-- 
2.53.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-10-29 14:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 13:20 [Devel] [PATCH hci-8.1 0/3] dm-qcow2: keep images of a read-only table unmodified Alexander Ivanov
2026-10-23 13:20 ` [Devel] [PATCH hci-8.1 1/3] drivers/md/dm-qcow2: treat images of a read-only table as read-only Alexander Ivanov
2026-10-23 13:24   ` no-reply
2026-10-29 11:36   ` Konstantin Khorenko
2026-10-23 13:20 ` [Devel] [PATCH hci-8.1 2/3] drivers/md/dm-qcow2: fail writes to a read-only table Alexander Ivanov
2026-10-23 13:23   ` no-reply
2026-10-28 10:35   ` Andrey Zhadchenko
2026-10-23 13:20 ` [Devel] [PATCH hci-8.1 3/3] drivers/md/dm-qcow2: do not revalidate inconsistent persistent bitmaps Alexander Ivanov
2026-10-23 13:25   ` no-reply
2026-10-23 13:58     ` Alexander Ivanov
2026-10-29 11:39   ` Konstantin Khorenko
2026-10-28 10:47 ` [Devel] [PATCH hci-8.1 0/3] dm-qcow2: keep images of a read-only table unmodified Andrey Zhadchenko
2026-10-29 11:42 ` Konstantin Khorenko
2026-10-29 14:48   ` Alexander Ivanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox