netfs.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfs: Fix read-retry for fs with no ->prepare_read()
@ 2025-01-07 14:43 David Howells
  2025-01-09 16:20 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2025-01-07 14:43 UTC (permalink / raw)
  To: Christian Brauner
  Cc: dhowells, Jeff Layton, netfs, linux-fsdevel, linux-kernel

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>
cc: Jeff Layton <jlayton@kernel.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
 fs/netfs/read_retry.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);
 			}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netfs: Fix read-retry for fs with no ->prepare_read()
  2025-01-07 14:43 [PATCH] netfs: Fix read-retry for fs with no ->prepare_read() David Howells
@ 2025-01-09 16:20 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2025-01-09 16:20 UTC (permalink / raw)
  To: David Howells
  Cc: Christian Brauner, Jeff Layton, netfs, linux-fsdevel,
	linux-kernel

On Tue, 07 Jan 2025 14:43:30 +0000, David Howells wrote:
> 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.
> 
> 

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] netfs: Fix read-retry for fs with no ->prepare_read()
      https://git.kernel.org/vfs/vfs/c/904abff4b1b9

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-09 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07 14:43 [PATCH] netfs: Fix read-retry for fs with no ->prepare_read() David Howells
2025-01-09 16:20 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).