From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B0D3248BA6; Wed, 15 Jan 2025 10:44:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736937863; cv=none; b=cVzLmRemL/O9vfodHBYPTai6lNI+UgHnwOK3QUcDdk/zOLkbewcPNiLtiPyRP9ftlKjgaP7UhaNWCmJfJsf4D17/Kr5O0E2Mgr1aMjR0RA2I7w0i+AfPMNz8piV23cAIZFeuHI9tGBx8JO85HvQCPDOh4u8CmQz4Gerf5GQUDLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736937863; c=relaxed/simple; bh=Kdxz0lyK8z7zX6L+U+/sPw/y8Tp+1OjDoriWgrtvo5I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gt4jzhpOiFjw3SD2ANDDpQ7TTBZ0bJ2MgXbV6NUkjdDyqnRBQWH3fy7nmle3Rh0FXwoJMH8AQDGcuND+rsCSXcA7VH1mQiEZnm3mXiuAhPbGWIJJi/F9m+1urgMU7Btz0pPBZPDE+zsVPZh+wiLL7c3SfJeA/mZSAX1WnO/MvAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UXaL2Uoa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="UXaL2Uoa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1D96C4CEE1; Wed, 15 Jan 2025 10:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736937863; bh=Kdxz0lyK8z7zX6L+U+/sPw/y8Tp+1OjDoriWgrtvo5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UXaL2UoavBmn/x5S41BULnKnAn6ZjiQGJgAROkAG/Y7gEmrdNPMWYWpxzTBNGhiyr HSJMIk43KvEBPBONzbZHLlgeiX++roR+XlVTQL+w94rtm8N3O3KEpXGOCAj4oqZwWS UnCKyiAuZEkAnyl95nFoQb1w0k9CJJ0/OKml9HKg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Howells , Jeff Layton , netfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, Christian Brauner , Sasha Levin Subject: [PATCH 6.12 014/189] netfs: Fix is-caching check in read-retry Date: Wed, 15 Jan 2025 11:35:10 +0100 Message-ID: <20250115103606.930204147@linuxfoundation.org> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250115103606.357764746@linuxfoundation.org> References: <20250115103606.357764746@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Howells [ Upstream commit d4e338de17cb6532bf805fae00db8b41e914009b ] 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 Link: https://lore.kernel.org/r/3752048.1734381285@warthog.procyon.org.uk cc: Jeff Layton cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin --- fs/netfs/read_retry.c | 2 +- include/linux/netfs.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/netfs/read_retry.c b/fs/netfs/read_retry.c index 0350592ea804..2701f7d45999 100644 --- a/fs/netfs/read_retry.c +++ b/fs/netfs/read_retry.c @@ -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) { diff --git a/include/linux/netfs.h b/include/linux/netfs.h index 5eaceef41e6c..474481ee8b7c 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -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 */ -- 2.39.5