From patchwork Mon Dec 16 20:34:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13910303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F010E7717F for ; Mon, 16 Dec 2024 20:35:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABA0B6B00A8; Mon, 16 Dec 2024 15:35:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A6B336B00A9; Mon, 16 Dec 2024 15:35:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9317E6B00AA; Mon, 16 Dec 2024 15:35:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 74A2D6B00A8 for ; Mon, 16 Dec 2024 15:35:01 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F302A120EDB for ; Mon, 16 Dec 2024 20:35:00 +0000 (UTC) X-FDA: 82901975520.26.289EB2B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 1A60D180003 for ; Mon, 16 Dec 2024 20:34:37 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=B+XNgytB; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734381271; a=rsa-sha256; cv=none; b=1QUL4ycrEr9fvL/5UN+VtawFcJ79LuE1lS/9mRPa+8/i+QY/2lI4vpgvfP/aIlML27WT3v HfH/oXyUDh6EqffvZqr7dv763ccaLv+CF8MeyDkORSeZP7nAxzCQDcDEPzrDaMLowAhDF1 qXkq2lFgCQfVk1kQATevmAU1TjBni80= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=B+XNgytB; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734381271; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3uel8b3F42MjWx1FV4MNqrLkM5e1s0/oyCwTXY7gJWI=; b=4tc03ITVmPnmhbIpoc7xDKuuMsu4DgZteHFZaiyp8kq+YnLcpll/x2pXBK3SgmlHutaHKw BrD0oe3B93konCPh8vnKiUvEJ2wxOoN8T2264WdV/v+fZ1hG7yNr0cyHx6PMitW/tyuGZn 6DVGnuYwRLOWCimmWH9ugy+fdsVGVkQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734381298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3uel8b3F42MjWx1FV4MNqrLkM5e1s0/oyCwTXY7gJWI=; b=B+XNgytB3gVcf1snhXo3wgvoyFWNGYnopas4t1JaW+Mt7WvNkHF3SAI7Y0GmuYzKTBew6c 90anPQNnqc1ofrb3TFUS1GxIqEbtxTO7DayjBptP8kYtnAGiSJhS1rqMyPGcP/CHZYxGC1 BQ6EIIqJ4Sgcc+N21O9S8SQuqHxW1nE= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-PLpJV9waPvq0rsK0CpjcQA-1; Mon, 16 Dec 2024 15:34:55 -0500 X-MC-Unique: PLpJV9waPvq0rsK0CpjcQA-1 X-Mimecast-MFC-AGG-ID: PLpJV9waPvq0rsK0CpjcQA Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B245219560A3; Mon, 16 Dec 2024 20:34:51 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.48]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6A88819560A2; Mon, 16 Dec 2024 20:34:46 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20241213135013.2964079-1-dhowells@redhat.com> References: <20241213135013.2964079-1-dhowells@redhat.com> To: Christian Brauner Cc: dhowells@redhat.com, Max Kellermann , Ilya Dryomov , Xiubo Li , Trond Myklebust , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/10] netfs: Fix is-caching check in read-retry MIME-Version: 1.0 Content-ID: <3752047.1734381285.1@warthog.procyon.org.uk> Date: Mon, 16 Dec 2024 20:34:45 +0000 Message-ID: <3752048.1734381285@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1A60D180003 X-Stat-Signature: wyn5y4dy3j7tzdx9nbanaxajc15sq69m X-Rspam-User: X-HE-Tag: 1734381277-384789 X-HE-Meta: U2FsdGVkX18Gl29nBFYylUKtlaxeXT4Pu8w8ggQ0Ou13TkhI0LDR7sxkcPNxonQ5Mbo5IO0KBpFbh4vJ8bn7yuUc8xi35vVHEf4ZrfZA+NPkM/Yw7MRiQr+XxK6wAnf+keLChUNYdxLud0fxm318ufCBY32klzcMoguHJHKKWaulxA8QsYaEMb4NScE5iZg/Ia8lO8TOjlSFivqW+xLIbIlHM+EDI90oH5lNq9gt0dhp+rFas/AQgeg4cPKHbR6fJJ4j4twX0EZMcw4dXNrj2aRAu4qEwFKfZFDqTfY1geOmlQ5qzY09JjreCEl3l3rxV0jKIALsUYC7vRx472BAQz4GbqGsXIBqzZ8U1nG5BDjusztyoFYoBAhHUEcmQOAGXtA/tex0xUX5ky1ttcPEczrf2EL94SEsa+KeIM/LIEFyKmY4so2P532QBTEtFItoHOUbrQ12wC2QyupP687g1zoGXscSUJ3VnRNXJaglxwjZ/3CJ/IVlD1CeF5O9DgKm24/uQid3/ne6Mc98nkRsVX95vU9Ohqiij46u27XWGH29muBSf7fWgOaadDFt8nVuUCive4fwZtA0V1ChwcMZEE6ImTXKNv/Xv/L7WY+mI1fDl2CGKTlwNAn44FLbq8GyDVwKbDITpml5UrIVlw8dLKofd+ivqEF0QsiSatQMAbWNpkoFefRH40AKVAZEjaRET+8JLe8pDbEUNuMR7acLC4+X+mMrF76yHlU/AQMNvasAJHRTHW8kcXx6RaLa5FxutKZQ5wbY5Do/0assCKSODFFq9fA+HeOnfHNyXBiGb5qUNs7RRaSykJLmWVKR/9pPqRdM8EnaeyTwch5IqciSrBpzeA/+pYoQ02uCh7opQSnL6waFMiL/Mzc1v/ZoaG38iC5hqJN99AI6hMBWm8vIcI7YhpJTlqLWFa/XlaXKPEg01JBTqx+/YolMMIswAwaBn/92Z2l50Ye9USf3kdY qUP2JEgu 77SdhL/Q2+jbrH/Fr/tmMZRFaIsEroZ54h806N6FdhiS4ceIXEwjS/No4SQ//zVxfhpsMcqYAYj2vzs1e0MMUTAUkxUv35jn42/8zng7Xv8kb9DjfaI36tiL8k9EJNP22pwUdabST1gaIKDx6kB/Y8fckYZ8gmZ+6dMwxdVws74x5REMn2YHACLKBF5SqlUYenCr/YzYwN0zz5ImIXsCK5w+IHj9y1TXm/EN2N/b38cOkNZ7qVHmun+DYaN+17Gr6bPu0qJ+7/M2ULo5Qe2rLwIpmbsCeWPIXfLbyYNnNFupuuSSfRvU25pc5Fv6Nrlglya56ntM/DvG6z2xy+/2G/TFhZbJDbs6nYfyD X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 cc: Jeff Layton cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- 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 0e72e9226fc8..21b4a54e545e 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 4083d77e3f39..ecdd5ced16a8 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 */