Linux NFS development
 help / color / mirror / Atom feed
* Re: [PATCH] lib: free pagelist on error in iov_iter_extract_pages()
       [not found] ` <CADUfDZpC5WOBY4_xvAy6ORtgQsxwFYj3Px81RdN7NKQZBFdJSQ@mail.gmail.com>
@ 2026-05-11  6:35   ` Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2026-05-11  6:35 UTC (permalink / raw)
  To: Caleb Sander Mateos
  Cc: Dmitry Antipov, Jens Axboe, Andrew Morton, Christoph Hellwig,
	linux-block, linux-fsdevel, lvc-project, Fedor Pchelkin,
	David Howells, ric Van Hensbergen, Latchesar Ionkov,
	Dominique Martinet, v9fs, Ilya Dryomov, Alex Markuze,
	Viacheslav Dubeyko, ceph-devel, Pranjal Shrivastava, linux-nfs,
	Christian Schoenebeck

[adding authors and maintainers of relevant code]

On Fri, May 08, 2026 at 11:33:50AM -0700, Caleb Sander Mateos wrote:
> iov_iter_extract_pages() will only allocate a pages array if the
> initial struct page ** passed is NULL (see want_pages_array()). So the
> condition pages != stack_pages will never be true. Indeed, it looks
> like *all* callers of iov_iter_extract_pages() pass a non-NULL struct
> page **. Would it make sense for iov_iter_extract_pages() to require a
> pre-allocated pages array and remove support for allocating one?

I think the idea was to support this to replace existing users of
iov_iter_get_pages_alloc2.  Which is urgently neede as those missing
the proper page pinning support.  OTOH we should not keep dead code
around just in case.

For NFS, Pranjal has an initial series to convert away from
iov_iter_get_pages_alloc2, which makes use of the NULL pages argument
to iov_iter_extract_pages.

For 9p, Dominique had an untested patch in December that drops
iov_iter_get_pages_alloc2 in favor of a much better high level approach
that doesn't even involve iov_iter_extract_pages, which seems to not have
made it anywhere.  It would be great to get this going again.

net/ceph/ needs to also do work.  Not an expert on the code, but given
how it is based off the encryption flag it looks kinda fishy and
iov_iter_extract_pages might not be the best direct replacement.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-11  6:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260508111329.329943-1-dmantipov@yandex.ru>
     [not found] ` <CADUfDZpC5WOBY4_xvAy6ORtgQsxwFYj3Px81RdN7NKQZBFdJSQ@mail.gmail.com>
2026-05-11  6:35   ` [PATCH] lib: free pagelist on error in iov_iter_extract_pages() Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox