Skip to content

Commit d4e338d

Browse files
dhowellsbrauner
authored andcommitted
netfs: Fix is-caching check in read-retry
netfs: Fix is-caching check in read-retry The read-retry code checks the NETFS_RREQ_COPY_TO_CACHE flag to determine if there might be failed reads from the cache that need turning into reads from the server, with the intention of skipping the complicated part if it can. The code that set the flag, however, got lost during the read-side rewrite. Fix the check to see if the cache_resources are valid instead. The flag can then be removed. Fixes: ee4cdf7 ("netfs: Speed up buffered reading") Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/r/3752048.1734381285@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>
1 parent d0327c8 commit d4e338d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

fs/netfs/read_retry.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void netfs_retry_read_subrequests(struct netfs_io_request *rreq)
4949
* up to the first permanently failed one.
5050
*/
5151
if (!rreq->netfs_ops->prepare_read &&
52-
!test_bit(NETFS_RREQ_COPY_TO_CACHE, &rreq->flags)) {
52+
!rreq->cache_resources.ops) {
5353
struct netfs_io_subrequest *subreq;
5454

5555
list_for_each_entry(subreq, &rreq->subrequests, rreq_link) {

include/linux/netfs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ struct netfs_io_request {
269269
size_t prev_donated; /* Fallback for subreq->prev_donated */
270270
refcount_t ref;
271271
unsigned long flags;
272-
#define NETFS_RREQ_COPY_TO_CACHE 1 /* Need to write to the cache */
273272
#define NETFS_RREQ_NO_UNLOCK_FOLIO 2 /* Don't unlock no_unlock_folio on completion */
274273
#define NETFS_RREQ_DONT_UNLOCK_FOLIOS 3 /* Don't unlock the folios on completion */
275274
#define NETFS_RREQ_FAILED 4 /* The request failed */

0 commit comments

Comments
 (0)