Message ID | 20241213135013.2964079-10-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 60C1DE7717F for <linux-mm@archiver.kernel.org>; Fri, 13 Dec 2024 13:51:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E8A836B009E; Fri, 13 Dec 2024 08:51:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E398B6B009F; Fri, 13 Dec 2024 08:51:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D01A56B00A0; Fri, 13 Dec 2024 08:51:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AFC746B009E for <linux-mm@kvack.org>; Fri, 13 Dec 2024 08:51:31 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 76425120E9D for <linux-mm@kvack.org>; Fri, 13 Dec 2024 13:51:31 +0000 (UTC) X-FDA: 82890072006.08.08D92F9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf05.hostedemail.com (Postfix) with ESMTP id C82F010001D for <linux-mm@kvack.org>; Fri, 13 Dec 2024 13:50:40 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hZhWmtxF; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf05.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734097865; a=rsa-sha256; cv=none; b=Lmvqz77WSNn004xdHxVKp7K7KBvEgyO1RP4M0VmRx56opIU05o+bqClAv6qQQVFZmsggmS ROIKyRaBWgwerednH+HuB6ojFOGWwHiWhpa7Uc+7s8Iuc46FEF6qRCIr7/l+vANG6Rg/WY sxiSUfH2aCIHd5HlI3IYDXQo7EL4J1k= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hZhWmtxF; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf05.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1734097865; 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=uxmqCJdKFxLw/y1tKF8ZCDzW6SWRkgRIhZKChhoKrx8=; b=shgW/KVU958S3jxfMiBD+ecoQPr9bK2eJeJrfVDq0+5McPuvHAvTjZGaDqw+8Y2naQ97VS SUowocxAe/bkoYyFUfEAIA5LePTvoWt2FwWJSggUHWdbBKSeEYBjyT8MF0ceiTwBqJoANl 2wdJNtyQzOTvdPdgHKW38/KGYODRYXQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734097889; 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=uxmqCJdKFxLw/y1tKF8ZCDzW6SWRkgRIhZKChhoKrx8=; b=hZhWmtxFvkwy4PGSwgaZns361J3sfMRa04hpPapFvdcg2XHpEiE1A5m8foCDlzI+ipWFX8 25pe3vva/EVyjzdp20BOAlYBnQP9wgAe++pvdPdM+zbkPFA8djBGiKzh1vLr5GmadeQ6AZ UBmMyQTqhER5AkPKcb3Bej1pcykUugM= Received: from mx-prod-mc-03.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-497-dpcO627eMBu77q5ky2OXKQ-1; Fri, 13 Dec 2024 08:51:23 -0500 X-MC-Unique: dpcO627eMBu77q5ky2OXKQ-1 X-Mimecast-MFC-AGG-ID: dpcO627eMBu77q5ky2OXKQ 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6AFF11955E95; Fri, 13 Dec 2024 13:51:21 +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 643061956086; Fri, 13 Dec 2024 13:51:16 +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 09/10] netfs: Fix ceph copy to cache on write-begin Date: Fri, 13 Dec 2024 13:50:09 +0000 Message-ID: <20241213135013.2964079-10-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-Server: rspam04 X-Rspamd-Queue-Id: C82F010001D X-Stat-Signature: 871jzgd4wyn14fxt37ewndubc7zewybw X-Rspam-User: X-HE-Tag: 1734097840-767248 X-HE-Meta: U2FsdGVkX1/8E+0MjW+SyYTX5kc2dgQ6AmaMM6R1/8D/LfxHPJUsWh3WFeJo0TTJ/pY0/SW/jv2W0NA6wmuraeaKcHe/kcxk7uczcUXC1FXCcDMrXfCbR/AZ5n28H7c0MGslVJM1wvKDR82x9rF5j+6CFgVmR3MTCns6J30yTCafaLr0AfNVRckofNIdOs9EaPAuIjnz7iUovGCdvZGsvqS730/EK9M8XbeJdL9Sq1/r4Z5xtwrEIPqA03r20b71QTv46QNR5QsO3aNf/W6Kng1eiyjAdeyT1S24d9M6J4nEMw5WBTpTvU3GjTBPMLk8F2neZbhC1J8+Kvj79+e/g8wVdOwRljhlH1jFz1BI4uBQjPelIUy79mgg+runX9RRuypLHqIxguZuyQ+/2GPe0GZ1F9ZHZoFsf0C5x3wlG5piHgFN4xp2/+iAMIVCL502xSWO+hiBX7QpdU/SYzQ/Mh/Hkg4LqQHyQkEKGP8XMSeRfGLyxBb1+Bi5Gt6k1FtKoIYLNA/tfexDb5OR2SiHh/VdEc1OY+PrEQPRN/1LDbsTcJaCn9ZtnBw7ESkC5WqKYHHcbyDv+3hRlPE/ypoFhLQoRv0ZgE1OyV8pWxx1gqfxMdUIIU5WO9aKwviJjFbHQIOOww3mEjy2AkiYGPA5+YVX2gz3ejh9xVu4m4jIzQ3MqHNnuZzED+BY/yaVW95GTuFi+f6YdK/6h/Z8MEJp5RozcHsA8Xwb7bqDTWTAf6ENNXMdosBqoDQK2b17Bax88Km5eTVBm6KqIoRyYvUfDgqqZk9Wxgb+QQTiuF0orsfwfer5XRTIC+PF7Jh5juWCfPd4nPDjsAvLruRhV9har86O7aPVXenZueTJhwteMY5BDrBI59HxUthkn2vKjJOxEtMWDfC/jcuhhtTV8BJNmqWVTVvLFOnSUh2bCoFiDE87uBeEQsGa1AVSeKProDpI8xmakomoMqXUWKPcI6K vdD81OYf u5OIsKv5562dEU8qHyU6fNYypDnSaM44my68i6a1SzEQnw9ALM2SeQFmnNobfOM6YUyYctYFLxcWdeY2gwuZm2fehJTxzfdX6G2J04qSMYASqNIu2ChZ5nfj5r4rU4q5BQJ4Sfv9t74oGsgfdpXacxRAmHETPA76SZV+Hes1pElxOeJlcBUpuZLSVk+vm429YpfETCah189q5hhc8c6A8YnTxiCg97ftpaWeB4bHs2Z3aHT+qoDNCSvPC6hUpR7qU1dfz3uc06Ycdu5YnyUMqCq2kgTta1xHJuy2Qg98jvVd1dzztDBcfNaJOsP3/2vIjJ3hxxsZWB/pJq8FmpQYZ0oDjUUWBE+ppg7RRFajan3/TDNTmXIKioh5cJfitFDWrnd/ZLb3nHI55sr5DBGBW3wlbkFLtJqu0FnpPd8McYVGl3wfiqxlCdyDlEw== 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_collect.c b/fs/netfs/read_collect.c index 47ed3a5044e2..e8624f5c7fcc 100644 --- a/fs/netfs/read_collect.c +++ b/fs/netfs/read_collect.c @@ -62,10 +62,14 @@ static void netfs_unlock_read_folio(struct netfs_io_subrequest *subreq, } else { trace_netfs_folio(folio, netfs_folio_trace_read_done); } + + folioq_clear(folioq, slot); } else { // TODO: Use of PG_private_2 is deprecated. if (test_bit(NETFS_SREQ_COPY_TO_CACHE, &subreq->flags)) netfs_pgpriv2_mark_copy_to_cache(subreq, rreq, folioq, slot); + else + folioq_clear(folioq, slot); } if (!test_bit(NETFS_RREQ_DONT_UNLOCK_FOLIOS, &rreq->flags)) { @@ -77,8 +81,6 @@ static void netfs_unlock_read_folio(struct netfs_io_subrequest *subreq, folio_unlock(folio); } } - - folioq_clear(folioq, slot); } /*
At the end of netfs_unlock_read_folio() in which folios are marked appropriately for copying to the cache (either with by being marked dirty and having their private data set or by having PG_private_2 set) and then unlocked, the folio_queue struct has the entry pointing to the folio cleared. This presents a problem for netfs_pgpriv2_write_to_the_cache(), which is used to write folios marked with PG_private_2 to the cache as it expects to be able to trawl the folio_queue list thereafter to find the relevant folios, leading to a hang. Fix this by not clearing the folio_queue entry if we're going to do the deprecated copy-to-cache. The clearance will be done instead as the folios are written to the cache. This can be reproduced by starting cachefiles, mounting a ceph filesystem with "-o fsc" and writing to it. Fixes: 796a4049640b ("netfs: In readahead, put the folio refs as soon extracted") 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_collect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)