]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netfs: release readahead folios on iterator preparation failure
authorYichong Chen <chenyichong@uniontech.com>
Mon, 27 Jul 2026 13:07:14 +0000 (14:07 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 28 Jul 2026 13:42:31 +0000 (15:42 +0200)
commit87eb3d272dcbcbbfe5c1576c10e5dc72810cf1f6
tree60cb44e8a0e982333e90718f03f33e27e0646c00
parent37a1c535c80c67d98668d190c7432f9ebda43310
netfs: release readahead folios on iterator preparation failure

netfs_prepare_read_iterator() batches readahead folios in put_batch so that
the folio references can be dropped after the I/O iterator has been
prepared.

If rolling_buffer_load_from_ra() fails after earlier folios have been
batched, the function returns immediately and leaves those references held.
Release the batch before returning the error.

Fixes: 06fa229ceb36 ("netfs: Abstract out a rolling folio buffer implementation")
Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260727130716.1099906-4-dhowells@redhat.com
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/netfs/buffered_read.c