Message ID | 20241213135013.2964079-11-dhowells@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 33FBCE7717D for <linux-mm@archiver.kernel.org>; Fri, 13 Dec 2024 13:51:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B55166B00A0; Fri, 13 Dec 2024 08:51:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B05786B00A1; Fri, 13 Dec 2024 08:51:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A6D66B00A2; Fri, 13 Dec 2024 08:51:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7BA416B00A0 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 08:51:38 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 37CD1A0F35 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 13:51:38 +0000 (UTC) X-FDA: 82890071628.20.95298F1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 41E1F180012 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 13:51:18 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=N6ljuulX; spf=pass (imf06.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734097869; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L1v5Uahl/uBNImxZaUKZS5taSNKrtxd0nK3bDl+BkV8=; b=QT5/Of3Op1UMA5jf8LYbKdAUhj+H5nQrLPZg69iu1Cumqe9tk/tcEdkTZ8CDnS4svLl3b/ l5D/sh5JPO+GKz8oTShWPWzLYuyNQ9hMoIVPonWYZGnatgXbpXk0mqxPLE5d0xY4uSQNee M9SPfLPEtHmB5siLz9ldBYEzTnwycZ8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734097869; a=rsa-sha256; cv=none; b=3PBmrX9dV/rMPxMnuJWAgNhEbyAwN2JPTl1ZMVsMwOYsgq7Rs5g7ACpFERgLxh25LV8bMu Bgk1leR17Hd2B60yoSCG55FZ31TgDuSbNt/Oo4tSDnmmQy5N2iRj30nwLEh+g4owQjxOum HLIOMFCnYVdDyKArntnzaqb2f9yhWqA= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=N6ljuulX; spf=pass (imf06.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734097895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L1v5Uahl/uBNImxZaUKZS5taSNKrtxd0nK3bDl+BkV8=; b=N6ljuulXK6aMhComeTOlsB/uqIdX5mSytwcMrpV2/WJtikll6J8EIJVMhue0ql6IBJ8cTP JVKR0g38hGNp7XwheTeGzzSekjbqej+o+66PBB6l3eiby+cEBFdxbOvdPLGXllDiPMHOM5 hAcMctQ9wu/IsDye0CxoyoayaEu/IAE= Received: from mx-prod-mc-05.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-473-iuxIXFenMlSlR7jWS7DojA-1; Fri, 13 Dec 2024 08:51:30 -0500 X-MC-Unique: iuxIXFenMlSlR7jWS7DojA-1 X-Mimecast-MFC-AGG-ID: iuxIXFenMlSlR7jWS7DojA Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 059B41955F08; Fri, 13 Dec 2024 13:51:28 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.48]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 056F31956086; Fri, 13 Dec 2024 13:51:22 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: Christian Brauner <christian@brauner.io> Cc: David Howells <dhowells@redhat.com>, Max Kellermann <max.kellermann@ionos.com>, Ilya Dryomov <idryomov@gmail.com>, Xiubo Li <xiubli@redhat.com>, Trond Myklebust <trondmy@kernel.org>, Jeff Layton <jlayton@kernel.org>, Matthew Wilcox <willy@infradead.org>, 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 10/10] netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled Date: Fri, 13 Dec 2024 13:50:10 +0000 Message-ID: <20241213135013.2964079-11-dhowells@redhat.com> In-Reply-To: <20241213135013.2964079-1-dhowells@redhat.com> References: <20241213135013.2964079-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Queue-Id: 41E1F180012 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 7sm5u6kerups9urjx5azbzq1qep6bqcu X-HE-Tag: 1734097878-436310 X-HE-Meta: U2FsdGVkX19RA8CipwdZ6L/DWCxVT17kT5KzUlcmlswyNP3goPNXwb3nmwlNureYtB0Tl2nD9RYfak7UKJVvufZKvHUF/hXtqBmVH0YYVfHI6sgBKi+GG6p1LFZ/ABzcnMehmVVvYUWgVpj72oCVpi7JB82EB60lwimDi9EfifOjYIfzeQbPfVE2Mv0TqTyOGg9gYLu+6T4SOb2MJAvnWiDORuG/mA13V3jhqjGeCYaWsqfxkpxB+QqKqUhWH4MwU5l8HyDmMEJOrCXkZiITLghzj+lr3Xbcx6QTLYzWFgDUiDml6bpQTcJo9OPqocLTDgFj4BSkWe9DbQ0WfmUFRaB4ZYh9Egyfc369mkXDAybtQypq/pFM0r2tHpwW9yAUoGjgh7CGt6b3iEoRtb28kCLllwGIvOV+nkCqdRzM6i5zPEPFLCWJc3e+7IjL95YkQIaF+JSqG0CA5xivEaoH19eMEihEU/prFUsVxGwSGa2LxnP4hCd/Zb+PSKBD/4ocge3vINLfrhPWxQ1dQOs7pbOuL1SQhLtLHqgfkTWCay1TeFFNhlp9aA8neqfV4U0SQoa5LM4igmB8sXA+b3jkIzvQHAkSIMU0D4a0uJFxirkR/Nbtrkf13lSYgr+D4EJzgTe0AiLBOtpYfntyoIES74idVmcx/5WB7+/c9tauSxALhTzqBZrtqkhmtK7ZqBQhuMg/+GFJLUx99hW+ZQ+HRfm5g1pPuG+bZzOGux5btgo8pLdo7UAs4uG98Kh1JBW71+gZEMBuyOGpHFjoXt3hxlLXFmUgeHwgf9b1hKBP5mH3iC9zotuF/+SpY7oiD71OF9ftlKlcLWJzQNi7ahcUANV9UlRbPFI/O1uZ1laMhG/vCdmQYZ1W4NRSikiVT9fM76N3XpRy/5xEDvc5fgdzKsmMeJoiz67U+XYjGHj+Pk1P394lhmNLmvyVlMLxMRh+iXfLp8AeNiBpWgxhM2B i7Xtj4fW Tk/iEYtWzrZ0/jRdLB15K8PMuW9fgGB7DZ5xm9+rlSxPEssXxqgNCHuPkRdWtnPTR0n+8G9Rg0ESeQyAdt99GBnB8w7QV4KnIoqxNgjVd9RIow/ykkmhv3wAJIfKhqeekvg1nYN3HQke/9uTL5/13nBFLevhIaobIeKEC4H8phaTa8DTpaNnf1XiFbBiOMaGBn++VkOaDDKFfoOi7NISDa7fIxpoeYHLGwPggIK59d6qZE2ZX9cyr49hAfoLB5TnRExP5q1Kou3WzRCnTE/5EfRe+2B74P+V4VAsDK2hNuWsWjlzhqbL3AeYjNZ7rRKp9xXRB8GAExwz4dNMj5JT8Bv86bLDtLqIPT9xhAgv7/iisD4arMh2k7UBRgXbgFaQDANKh0ytZldCYZI9Iqw8FsIcxYMEOmP05bHgtFTCG+x6jw7iRYRX/II/PIg== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
netfs, ceph, nfs, cachefiles: Miscellaneous fixes/changes
|
expand
|
diff --git a/fs/netfs/read_pgpriv2.c b/fs/netfs/read_pgpriv2.c index ba5af89d37fa..54d5004fec18 100644 --- a/fs/netfs/read_pgpriv2.c +++ b/fs/netfs/read_pgpriv2.c @@ -170,6 +170,10 @@ void netfs_pgpriv2_write_to_the_cache(struct netfs_io_request *rreq) trace_netfs_write(wreq, netfs_write_trace_copy_to_cache); netfs_stat(&netfs_n_wh_copy_to_cache); + if (!wreq->io_streams[1].avail) { + netfs_put_request(wreq, false, netfs_rreq_trace_put_return); + goto couldnt_start; + } for (;;) { error = netfs_pgpriv2_copy_folio(wreq, folio);
When the caching for a cookie is temporarily disabled (e.g. due to a DIO write on that file), future copying to the cache for that file is disabled until all fds open on that file are closed. However, if netfslib is using the deprecated PG_private_2 method (such as is currently used by ceph), and decides it wants to copy to the cache, netfs_advance_write() will just bail at the first check seeing that the cache stream is unavailable, and indicate that it dealt with all the content. This means that we have no subrequests to provide notifications to drive the state machine or even to pin the request and the request just gets discarded, leaving the folios with PG_private_2 set. Fix this by jumping directly to cancel the request if the cache is not available. That way, we don't remove mark3 from the folio_queue list and netfs_pgpriv2_cancel() will clean up the folios. This was found by running the generic/013 xfstest against ceph with an active cache and the "-o fsc" option passed to ceph. That would usually hang Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading") Reported-by: Max Kellermann <max.kellermann@ionos.com> Closes: https://lore.kernel.org/r/CAKPOu+_4m80thNy5_fvROoxBm689YtA0dZ-=gcmkzwYSY4syqw@mail.gmail.com/ Signed-off-by: David Howells <dhowells@redhat.com> cc: Jeff Layton <jlayton@kernel.org> cc: Ilya Dryomov <idryomov@gmail.com> cc: Xiubo Li <xiubli@redhat.com> cc: netfs@lists.linux.dev cc: ceph-devel@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- fs/netfs/read_pgpriv2.c | 4 ++++ 1 file changed, 4 insertions(+)