From: Dominique Martinet via B4 Relay <devnull+asmadeus.codewreck.org@kernel.org>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Christian Brauner <brauner@kernel.org>,
David Howells <dhowells@redhat.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Maximilian Bosch <maximilian@mbosch.me>,
Ryan Lahfa <ryan@lahfa.xyz>,
Christian Theune <ct@flyingcircus.io>,
Arnout Engelen <arnout@bzzt.net>,
linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
Dominique Martinet <asmadeus@codewreck.org>,
stable@vger.kernel.org
Subject: [PATCH 0/2] iterate_folioq bug when offset==size (Was: [REGRESSION] 9pfs issues on 6.12-rc1)
Date: Mon, 11 Aug 2025 16:39:04 +0900 [thread overview]
Message-ID: <20250811-iot_iter_folio-v1-0-d9c223adf93c@codewreck.org> (raw)
So we've had this regression in 9p for.. almost a year, which is way too
long, but there was no "easy" reproducer until yesterday (thank you
again!!)
It turned out to be a bug with iov_iter on folios,
iov_iter_get_pages_alloc2() would advance the iov_iter correctly up to
the end edge of a folio and the later copy_to_iter() fails on the
iterate_folioq() bug.
Happy to consider alternative ways of fixing this, now there's a
reproducer it's all much clearer; for the bug to be visible we basically
need to make and IO with non-contiguous folios in the iov_iter which is
not obvious to test with synthetic VMs, with size that triggers a
zero-copy read followed by a non-zero-copy read.
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
---
Dominique Martinet (2):
iov_iter: iterate_folioq: fix handling of offset >= folio size
iov_iter: iov_folioq_get_pages: don't leave empty slot behind
include/linux/iov_iter.h | 3 +++
lib/iov_iter.c | 6 +++---
2 files changed, 6 insertions(+), 3 deletions(-)
---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250811-iot_iter_folio-1b7849f88fed
Best regards,
--
Dominique Martinet <asmadeus@codewreck.org>
next reply other threads:[~2025-08-11 7:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 7:39 Dominique Martinet via B4 Relay [this message]
2025-08-11 7:39 ` [PATCH 1/2] iov_iter: iterate_folioq: fix handling of offset >= folio size Dominique Martinet via B4 Relay
2025-08-11 18:55 ` kernel test robot
2025-08-13 5:16 ` Nathan Chancellor
2025-08-13 5:34 ` Dominique Martinet
2025-08-13 13:39 ` Andy Shevchenko
2025-08-13 13:45 ` Dominique Martinet
2025-08-13 13:52 ` Andy Shevchenko
2025-08-14 1:14 ` Dominique Martinet
2025-08-13 23:04 ` Paul E. McKenney
2025-08-13 13:49 ` David Howells
2025-08-11 7:39 ` [PATCH 2/2] iov_iter: iov_folioq_get_pages: don't leave empty slot behind Dominique Martinet via B4 Relay
2025-08-11 13:13 ` Arnout Engelen
2025-08-11 14:37 ` [PATCH 1/2] iov_iter: iterate_folioq: fix handling of offset >= folio size David Howells
2025-08-11 21:37 ` asmadeus
2025-08-12 9:34 ` David Howells
2025-08-12 21:13 ` asmadeus
2025-08-11 14:38 ` [PATCH 2/2] iov_iter: iov_folioq_get_pages: don't leave empty slot behind David Howells
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=20250811-iot_iter_folio-v1-0-d9c223adf93c@codewreck.org \
--to=devnull+asmadeus.codewreck.org@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnout@bzzt.net \
--cc=asmadeus@codewreck.org \
--cc=brauner@kernel.org \
--cc=ct@flyingcircus.io \
--cc=dhowells@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maximilian@mbosch.me \
--cc=ryan@lahfa.xyz \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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
all inboxes | Powered by JetHome®