From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2] dm-qcow2: fix a short image read resubmitted at the wrong sector
Date: Thu, 19 Nov 2026 17:39:41 +0100 [thread overview]
Message-ID: <179510638141.1461989.18064232003010591859.b4-review@b4> (raw)
In-Reply-To: <20261119142956.998039-1-den@openvz.org>
Applying, after the read livelock v2 series, with these fixes on my
side:
- "A read-only image whose file ends inside a sector" -> "A truncated
or otherwise damaged read-only image whose file ends inside a sector".
- "which would rewrite good bytes at the rounded-down offset" -> "whose
resubmit would put the rest of the data below where it belongs".
On Thu, 19 Nov 2026 15:29:56 +0100, Denis V. Lunev wrote:
> A read-only image whose file ends inside a sector and a page or more
> short of the read gets such a read. On ext4 or xfs the O_DIRECT
A well-formed image never gets there: a compressed cluster at EOF is
read up to the next page, so less than a page is missing and it is
zero-filled; a plain cluster ends on a sector. Only an L2 entry that
points past the end of a truncated file does it.
> which would rewrite good bytes at the rounded-down offset, instead of
> resubmitting it.
The resubmitted write puts buf[ret..] at pos + round_down(ret, 512):
every remaining byte lands (ret & 511) bytes too low, and the last
(ret & 511) bytes of the range are never written.
Separate patches, not needed for this one. I created a task:
1. A write that returns 0 bytes still hits WARN_ON_ONCE() and is
resubmitted unchanged, forever if a FUSE daemon keeps answering 0;
it should fail with -EIO as a read does.
https://virtuozzo.atlassian.net/browse/VSTOR-156109
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-19 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 14:29 Denis V. Lunev
2026-11-19 16:11 ` Alexander Ivanov
2026-11-19 16:39 ` Konstantin Khorenko [this message]
2026-11-19 16:39 ` Konstantin Khorenko
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=179510638141.1461989.18064232003010591859.b4-review@b4 \
--to=khorenko@virtuozzo.com \
--cc=den@openvz.org \
--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