]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netfs: In readahead, put the folio refs as soon extracted
authorDavid Howells <dhowells@redhat.com>
Fri, 4 Oct 2024 14:33:58 +0000 (15:33 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 7 Oct 2024 11:48:22 +0000 (13:48 +0200)
commit796a4049640b54cb1daf9e7fe543292c5ca02c74
tree23297c8976b96683ebb392a1bfaffe7f4f4ab374
parent8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b
netfs: In readahead, put the folio refs as soon extracted

netfslib currently defers dropping the ref on the folios it obtains during
readahead to after it has started I/O on the basis that we can do it whilst
we wait for the I/O to complete, but this runs the risk of the I/O
collection racing with this in future.

Furthermore, Matthew Wilcox strongly suggests that the refs should be
dropped immediately, as readahead_folio() does (netfslib is using
__readahead_batch() which doesn't drop the refs).

Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
Suggested-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/3771538.1728052438@warthog.procyon.org.uk
cc: Jeff Layton <jlayton@kernel.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/netfs/buffered_read.c
fs/netfs/read_collect.c
include/trace/events/netfs.h