From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 2/3] drivers/md/dm-qcow2: fail writes to a read-only table
Date: Wed, 28 Oct 2026 11:35:47 +0100 [thread overview]
Message-ID: <ae986466-31cd-4075-bc77-b9ad6a043443@virtuozzo.com> (raw)
In-Reply-To: <20261023132008.2304901-3-alexander.ivanov@virtuozzo.com>
On 10/23/26 15:20, Alexander Ivanov wrote:
> bio_check_ro() only warns about a write to a read-only disk and lets it
> through. dm-qcow2 then allocates clusters in the top image although
> the table is read-only. The header is not updated for a read-only
> table, so enabled persistent bitmaps stay marked consistent while the
> image data changes under them.
>
> Kill write requests in .clone_and_map when the table is read-only.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-138887
> Feature: dm-qcow2: block device over QCOW2 files driver
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
> ---
> drivers/md/dm-qcow2-map.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
> index 54b3a345f927..26fdfce09aa7 100644
> --- a/drivers/md/dm-qcow2-map.c
> +++ b/drivers/md/dm-qcow2-map.c
> @@ -4506,6 +4506,11 @@ int qcow2_clone_and_map(struct dm_target *ti, struct request *rq,
> struct qcow2_rq *qrq;
> struct qio *qio;
>
> + /* The block layer only warns about writes to a read-only disk */
Let's not litter the code with the useless comments. Killing write
request on non-write device does not need any extra info.
> + if (op_is_write(req_op(rq)) &&
> + !(dm_table_get_mode(ti->table) & BLK_OPEN_WRITE))
> + return DM_MAPIO_KILL;
> +
> qrq = mempool_alloc(tgt->qrq_pool, GFP_ATOMIC);
> if (!qrq)
> return DM_MAPIO_KILL;
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-10-28 10:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ae986466-31cd-4075-bc77-b9ad6a043443@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
--cc=alexander.ivanov@virtuozzo.com \
--cc=devel@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox