]> Git Repo - J-linux.git/commitdiff
netfs: Fix is-caching check in read-retry
authorDavid Howells <[email protected]>
Mon, 16 Dec 2024 20:34:45 +0000 (20:34 +0000)
committerChristian Brauner <[email protected]>
Fri, 20 Dec 2024 21:07:58 +0000 (22:07 +0100)
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: ee4cdf7ba857 ("netfs: Speed up buffered reading")
Signed-off-by: David Howells <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
cc: Jeff Layton <[email protected]>
cc: [email protected]
cc: [email protected]
Signed-off-by: Christian Brauner <[email protected]>
fs/netfs/read_retry.c
include/linux/netfs.h

index 0e72e9226fc8809a07474777016c140316352b6a..21b4a54e545e1132abfd5e3df1b1f74fc76f617a 100644 (file)
@@ -49,7 +49,7 @@ static void netfs_retry_read_subrequests(struct netfs_io_request *rreq)
         * up to the first permanently failed one.
         */
        if (!rreq->netfs_ops->prepare_read &&
-           !test_bit(NETFS_RREQ_COPY_TO_CACHE, &rreq->flags)) {
+           !rreq->cache_resources.ops) {
                struct netfs_io_subrequest *subreq;
 
                list_for_each_entry(subreq, &rreq->subrequests, rreq_link) {
index 4083d77e3f39d7db42f4f80da3c9a017f7fdca85..ecdd5ced16a8481369234ae606f21d525635b3bd 100644 (file)
@@ -269,7 +269,6 @@ struct netfs_io_request {
        size_t                  prev_donated;   /* Fallback for subreq->prev_donated */
        refcount_t              ref;
        unsigned long           flags;
-#define NETFS_RREQ_COPY_TO_CACHE       1       /* Need to write to the cache */
 #define NETFS_RREQ_NO_UNLOCK_FOLIO     2       /* Don't unlock no_unlock_folio on completion */
 #define NETFS_RREQ_DONT_UNLOCK_FOLIOS  3       /* Don't unlock the folios on completion */
 #define NETFS_RREQ_FAILED              4       /* The request failed */
This page took 0.050427 seconds and 4 git commands to generate.