Re: [PATCH v6 21/34] 9p: Pin pages rather than ref'ing if appropriate

From: Christoph Hellwig
Date: Thu Jan 19 2023 - 11:53:00 EST


On Thu, Jan 19, 2023 at 04:44:14PM +0000, David Howells wrote:
> Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> You're right. I wonder if I should handle ITER_KVEC in
> iov_iter_extract_pages(), though I'm sure I've been told that a kvec might
> point to data that doesn't have a matching page struct. Or maybe it's that
> the refcount shouldn't be changed on it.

They could in theory contain non-page backed memory, even if I don't
think we currently have that in tree. The worst case is probably
vmalloc()ed memory. Many instance will have no good way to deal with
something that isn't page backed. That's one reason why I'd relaly
love to see ITER_KVEC go away - for most use cases ITER_BVEC is the
right thing, and the others are probably broken for various combinations
already, but that's going to be a fair amount of work. For now just
failing the I/O if the instance can't deal with it is probably the
right thing.