From: Dominique Martinet <asmadeus@codewreck.org>
To: Christian Schoenebeck <linux_oss@crudebyte.com>
Cc: Matthew Wilcox <willy@infradead.org>,
Chris Arges <carges@cloudflare.com>,
David Howells <dhowells@redhat.com>,
ericvh@kernel.org, lucho@ionkov.net, v9fs@lists.linux.dev,
linux-kernel@vger.kernel.org, kernel-team@cloudflare.com
Subject: Re: kernel BUG when mounting large block xfs backed by 9p (folio ref count bug)
Date: Fri, 5 Dec 2025 22:48:55 +0900 [thread overview]
Message-ID: <aTLix4bcHo_XDXpf@codewreck.org> (raw)
In-Reply-To: <2245723.irdbgypaU6@weasel>
Christian Schoenebeck wrote on Fri, Dec 05, 2025 at 02:36:41PM +0100:
> Haven't checked yet, but shouldn't it be like this?
>
> diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
> index 0b8086f58ad5..5ff4bfe25a3e 100644
> --- a/net/9p/trans_virtio.c
> +++ b/net/9p/trans_virtio.c
> @@ -318,7 +318,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan,
> if (!iov_iter_count(data))
> return 0;
>
> - if (!iov_iter_is_kvec(data)) {
> + if (iov_iter_is_iovec(data)) {
Hmm, __iov_iter_get_pages_alloc() is supposed to handle any of these:
user_backed_iter() (iter_is_ubuf() || iter_is_iovec()),
iov_iter_is_bvec(),
iov_iter_is_folioq(),
iov_iter_is_xarray()
so it would EFAULT on stuff like is_discard() and is_kvec(), but in our
case (folio) it also depends on what backs the folio, and just the type
of the iov isn't enough to tell
Your patch will appear to work (folioq path won't go there so the page
won't be pinned), but I'm not sure just being a folio is enough of a
guarantee here? for example is a folio coming from page cache
(e.g. readahead) guaranteed to be stable while it is being read? Can
something (try to) kill that thread while the IO is in progress and
reclaim the memory?
--
Dominique Martinet | Asmadeus
next prev parent reply other threads:[~2025-12-05 13:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 15:47 kernel BUG when mounting filesystem on 9p Chris Arges
2025-11-24 23:12 ` kernel BUG when mounting large block xfs backed by 9p (folio ref count bug) Dominique Martinet
2025-11-24 23:55 ` Matthew Wilcox
2025-11-25 9:03 ` Dominique Martinet
2025-12-05 4:53 ` Matthew Wilcox
2025-12-05 10:47 ` Christian Schoenebeck
2025-12-05 13:03 ` Dominique Martinet
2025-12-05 13:36 ` Christian Schoenebeck
2025-12-05 13:48 ` Dominique Martinet [this message]
2025-12-07 7:18 ` Matthew Wilcox
2025-12-07 13:49 ` Dominique Martinet
2025-12-08 17:21 ` Chris Arges
2025-12-09 9:52 ` Christian Schoenebeck
2025-11-25 15:52 ` Chris Arges
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=aTLix4bcHo_XDXpf@codewreck.org \
--to=asmadeus@codewreck.org \
--cc=carges@cloudflare.com \
--cc=dhowells@redhat.com \
--cc=ericvh@kernel.org \
--cc=kernel-team@cloudflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux_oss@crudebyte.com \
--cc=lucho@ionkov.net \
--cc=v9fs@lists.linux.dev \
--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