From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Subject: [Devel] [PATCH VZ10 1/6] drivers/md/dm-qcow2: fix lower delta seek window clamp
Date: Mon, 10 Aug 2026 15:29:55 +0300 [thread overview]
Message-ID: <20260810123000.19834-2-andrey.zhadchenko@virtuozzo.com> (raw)
In-Reply-To: <20260810123000.19834-1-andrey.zhadchenko@virtuozzo.com>
size may be smaller than old_qio->bi_iter.bi_size: we calculate it
beforehand with calc_front_qio_bytes().
https://virtuozzo.atlassian.net/browse/VSTOR-139407
Feature: dm-qcow2: block device over QCOW2 files driver
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
---
drivers/md/dm-qcow2-map.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index db21efb45e17a..542c7949321e5 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -4437,12 +4437,11 @@ static inline void seek_qio_next_clu(struct qio *qio, struct qcow2_map *map)
static struct qio *advance_and_spawn_lower_seek_qio(struct qio *old_qio, u32 size)
{
struct qio *new_qio;
- loff_t start, old_end;
+ loff_t start;
start = to_bytes(old_qio->bi_iter.bi_sector);
- old_end = start + old_qio->bi_iter.bi_size;
- if (old_end > old_qio->qcow2->lower->hdr.size)
+ if (start + size > old_qio->qcow2->lower->hdr.size)
size = old_qio->qcow2->lower->hdr.size - start;
new_qio = alloc_seek_qio(old_qio->qcow2->lower, old_qio, start + size);
--
2.43.5
next prev parent reply other threads:[~2026-08-10 12:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 12:29 [Devel] [PATCH VZ10 0/6] dm-qcow: lseek improvements Andrey Zhadchenko
2026-08-10 12:29 ` Andrey Zhadchenko [this message]
2026-08-10 12:29 ` [Devel] [PATCH VZ10 2/6] drivers/md/dm-qcow2: keep seek parse window within limit Andrey Zhadchenko
2026-08-14 9:55 ` Pavel Tikhomirov
2026-08-14 10:26 ` Andrey Zhadchenko
2026-08-10 12:29 ` [Devel] [PATCH VZ10 3/6] drivers/md/dm-qcow2: fix seek constant comparison Andrey Zhadchenko
2026-08-10 12:29 ` [Devel] [PATCH VZ10 4/6] drivers/md/dm-qcow2: fix seek skip to the next L2 table Andrey Zhadchenko
2026-08-14 10:25 ` Pavel Tikhomirov
2026-08-14 10:33 ` Andrey Zhadchenko
2026-08-10 12:29 ` [Devel] [PATCH VZ10 5/6] drivers/md/dm-qcow2: scan lower delta in one pass over empty L1 entry Andrey Zhadchenko
2026-08-14 11:09 ` Pavel Tikhomirov
2026-08-14 12:00 ` Andrey Zhadchenko
2026-08-10 12:30 ` [Devel] [PATCH VZ10 6/6] drivers/md/dm-qcow2: seek unallocated L2 entries in one pass within md Andrey Zhadchenko
2026-08-12 12:42 ` Vasileios Almpanis
2026-08-12 12:50 ` Andrey Zhadchenko
2026-08-14 11:55 ` [Devel] [PATCH VZ10 0/6] dm-qcow: lseek improvements Pavel Tikhomirov
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=20260810123000.19834-2-andrey.zhadchenko@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
/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