Re: [PATCH] 9p/virtio: restrict page pinning to user_backed_iter() iovec

Christian Schoenebeck
2025-12-10T13:34:14Z

On Wednesday, 10 December 2025 07:04:30 CET Christoph Hellwig wrote:
> On Wed, Dec 10, 2025 at 06:04:23AM +0900, Dominique Martinet via B4 Relay
> wrote:
[...]
> > The problem is that iov_iter_get_pages_alloc2() apparently cannot be
> > called on folios (as illustrated by the backtrace below), so limit what
> > iov we can pin from !iov_iter_is_kvec() to user_backed_iter()
>
> As willy pointed out this is a kmalloc.
>
> And 9p (just like NFS) really needs to switch away from
> iov_iter_get_pages_alloc2 to iov_iter_extract_pages, which handles not
> just this perfectly fine but also fixes various other issues.
>
> Note that the networking code still wants special treatment for kmalloc
> pages, so you might have more work there.

But couldn't this patch be used as a preliminary solution for this issue
before switching to iov_iter_extract_pages(), as the latter does not look like
a trivial change?

Maybe I'm still missing something important here, not sure.

/Christian