diff options
author | David Howells <dhowells@redhat.com> | 2025-01-07 15:43:30 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-01-09 17:20:04 +0100 |
commit | 904abff4b1b94184aaa0e9f5fce7821f7b5b81a3 (patch) | |
tree | dad39819b434efbd82a3c9801fe5d96d6cb508d2 | |
parent | netfs: Fix kernel async DIO (diff) | |
download | linux-904abff4b1b94184aaa0e9f5fce7821f7b5b81a3.tar.xz linux-904abff4b1b94184aaa0e9f5fce7821f7b5b81a3.zip |
netfs: Fix read-retry for fs with no ->prepare_read()
Fix netfslib's read-retry to only call ->prepare_read() in the backing
filesystem such a function is provided. We can get to this point if a
there's an active cache as failed reads from the cache need negotiating
with the server instead.
Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/529329.1736261010@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>
-rw-r--r-- | fs/netfs/read_retry.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/netfs/read_retry.c b/fs/netfs/read_retry.c index 21b4a54e545e..16b676c68dcd 100644 --- a/fs/netfs/read_retry.c +++ b/fs/netfs/read_retry.c @@ -152,7 +152,8 @@ static void netfs_retry_read_subrequests(struct netfs_io_request *rreq) BUG_ON(!len); /* Renegotiate max_len (rsize) */ - if (rreq->netfs_ops->prepare_read(subreq) < 0) { + if (rreq->netfs_ops->prepare_read && + rreq->netfs_ops->prepare_read(subreq) < 0) { trace_netfs_sreq(subreq, netfs_sreq_trace_reprep_failed); __set_bit(NETFS_SREQ_FAILED, &subreq->flags); } |