Message ID | 20240823200819.532106-4-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 5B534C5321D for <linux-mm@archiver.kernel.org>; Fri, 23 Aug 2024 20:08:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA4106B0279; Fri, 23 Aug 2024 16:08:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D539C6B0278; Fri, 23 Aug 2024 16:08:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCC9C6B0279; Fri, 23 Aug 2024 16:08:55 -0400 (EDT) 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 93D916B0276 for <linux-mm@kvack.org>; Fri, 23 Aug 2024 16:08:55 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 1E6241A00E0 for <linux-mm@kvack.org>; Fri, 23 Aug 2024 20:08:55 +0000 (UTC) X-FDA: 82484598630.05.44FCEDE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 6B562C000D for <linux-mm@kvack.org>; Fri, 23 Aug 2024 20:08:53 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ekz4yxq1; spf=pass (imf28.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=1724443623; 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=B4tfOtZ3an7b1aGGuqLauY14dten5jR69+zwwl0cSBE=; b=rMRkcKek9lVISY3DopYxhGhNsAhcFddf3ky4pWgjlz0j1lBPyDJwLsbE/6Eac0VZxxf2fW 60jfAHfRFNN4UZiI+5bCpLtO1YQeNSeQHmljCusOWWZnjLZ8KmpahGPogSvgHLUh7D4Tmf qW6t9hCphN6LIWZl61OkYld6g46O8AA= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ekz4yxq1; spf=pass (imf28.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724443623; a=rsa-sha256; cv=none; b=CrTEOuH/74ztu1f4T+ABMUwmh0p+sCKHddPfojgsJaYng7T/zzY0D8xdpF1kk7bPRa4bkH JR/uGDQ+1hyjn6HNPmp0EIOKyNmQ6ur1HEize+MY5lgLHmpLFscuxA7K2U3QI2CP3ba7q8 Eu4L6JMXv3kOMwX8Hi5X1oW0+yzehzs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724443732; 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=B4tfOtZ3an7b1aGGuqLauY14dten5jR69+zwwl0cSBE=; b=ekz4yxq1RLQzM5Xgnwd9faEVqSNzz4WywcsTRXv/TnieTnLRJ+uIN5CFnBzRVyCUoMVF2H GgYOMpc8dEXHQyKjeJfLjZglTPo8F+sWPJwlzewJjyF8tRCEkr79AteZfSBsIf1g88R2HH JBb1GPKUGDcELj0snBvEPdnRvQUamp8= 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-439-JPiGnaA-NR6p3XE_f4cFaQ-1; Fri, 23 Aug 2024 16:08:49 -0400 X-MC-Unique: JPiGnaA-NR6p3XE_f4cFaQ-1 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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 385D61955D50; Fri, 23 Aug 2024 20:08:47 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.30]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D8E451955DD8; Fri, 23 Aug 2024 20:08:41 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: Christian Brauner <christian@brauner.io>, Steve French <sfrench@samba.org> Cc: David Howells <dhowells@redhat.com>, Pankaj Raghav <p.raghav@samsung.com>, Paulo Alcantara <pc@manguebit.com>, 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, Marc Dionne <marc.dionne@auristor.com> Subject: [PATCH 3/9] netfs: Fix netfs_release_folio() to say no if folio dirty Date: Fri, 23 Aug 2024 21:08:11 +0100 Message-ID: <20240823200819.532106-4-dhowells@redhat.com> In-Reply-To: <20240823200819.532106-1-dhowells@redhat.com> References: <20240823200819.532106-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: rspam06 X-Rspamd-Queue-Id: 6B562C000D X-Stat-Signature: owzfsdkywcutxnzdjzpp1xhk15koy3mf X-Rspam-User: X-HE-Tag: 1724443733-264326 X-HE-Meta: U2FsdGVkX18Kra0EKL8QUCnlIG0m1EPOZaWmEFRiz8/0U2Oenv4j/lPwQ9z9lRL5q7YvYCE6kzjfCXMVJGS7/T+g8XRb4qWhlAmgL7EURVONEItSKOErBCyMyuaAyzKC8vrd1xO389eg4r85F+j6c8dX7J0XP/BMj0RxOFvZYa/MXxIpeMiSObzwUQ+rh0gqUnmCDIhxAmffM44qsf22gkiL7WlvHmVKKjExQCFXl+eqxfwkodGDuinFKZ8vEHYiUUI1JCliUPgSCROB3QiNauOmKS4OsUa3cwUAZrKcqfXGPmkRFBB8ZzcetHtEFKp9x/VrER5Mmm5LB53jNAUbLkJG1xwR5wSNZ6S2YnmjRQVtJZTO47cUxlNu9G2pNyQYGhunanJVe6YHMQkVcx/bGdN1yC11OBrq0BMnuqQ5wRofpJ5bZFexPyZOVoi+Zql7Yt8dHC+2QA1WEyBC3pjihIgmWYE+fo71/xMq4Xlexpi+w4U4OHdhCCZZukZHgnFj+DL0EhSvioIQ9Vzh9Ym7/MhBOZfeq+kka2pdd+5g3Ig8ch+SGJrP50Z2TcCIRkMTv5OuB5CFLIPNOHDKqaPRQnWBaLOtZ0pLXmlRGhdJ9ubxNauXsMse0xsXWcH7Xv1saVx3pgcWwPMJHu6E576fCSrAmBjCfTWqlcYq+pWD/Bc6DyPhsevbcPodkmGPOQ2glZZ5uwwu9AY5/tfufs9RzUgGtmOfvs8FX/DTpnBIqZ/W2AIXCP2uwCbEXfC4Q/1+rLdmWIcXH3Id1yGCR8smZ7yqmO4TV4vLJeqjZlvOx6WC8CSlALG9lkHDQeJpWHNdY+Hyf41Ndc0gZVmhfZlWkX8YkDbsaNPxhOFp0F2ODPEeGjhivpWnXc9cI3XbE8aFpEgIQE3RnUgHqq+f2ZY/iYFofiHuvZOJ3T4HPVN+8+bd2zDUYLZMF/6ttoyys3u8hovmVRFkxpirAL1ZSe3 KaAoAGfF N8bPjjUscY/V79lng/pDIFZ0/4Ul2t8n5bxYfppBzvIvmPjB1+t/TXVQf5l3jeioeTdnDXOf4r3RZ9wlNSTnApHMVg4iA6O16901uGcJBMbDbLwJCU4ZHh0pRXwO/W5v29fsZpp9+sA3M5CTpHoeGeOsXChTLJ+quhOJ7CWrWLfO3EdRWcRNl03ePANs6EdzWdK/wi7gr6NoDTkRstU8hTRNzT/TkWd/L7k7t9iLvDFRPemcrl8GC9BmURROPUrB7l1fucYnCdef58omIl5mSlxxNPoh21Yq+1Nc3zBmx4/0hAkv7stv31n8YUthqnbG2sjR5mKir5+PxvW+1tin4KnJLTY8/6AznqVjfPce0rmt/AQRx5JLwDjgMxdCxvgPn43ZhnDcHrnFVdMwdKtpafPsa/3061vOKDsd6XBxYLMBIhm2cUwm57z8o9CfXKSauQaENVZPEboOcIaoQyfiUzkukUWHAcRDIyqPi4rX7ffhrQYxThCr2Dtpk0dvlLY/n4vxgg5TwlFA+DYDeC/sshEHht8nZCb/JNSRq2QOaZtMoEsTUGZ8HYNJnUQY1zsP4bknuFwoH0LqxrcUB5ezA/8tYZxaXjOrGQFIfmU1dm1zx7EYERXgCmbkSw5SZ3DBH6OXodinJeR/COlLW9tdsxNN5qcput3Amo3Ka 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, cifs: Combined repost of fixes for truncation, DIO read and read-retry
|
expand
|
diff --git a/fs/netfs/misc.c b/fs/netfs/misc.c index 554a1a4615ad..69324761fcf7 100644 --- a/fs/netfs/misc.c +++ b/fs/netfs/misc.c @@ -161,6 +161,9 @@ bool netfs_release_folio(struct folio *folio, gfp_t gfp) struct netfs_inode *ctx = netfs_inode(folio_inode(folio)); unsigned long long end; + if (folio_test_dirty(folio)) + return false; + end = folio_pos(folio) + folio_size(folio); if (end > ctx->zero_point) ctx->zero_point = end;
Fix netfs_release_folio() to say no (ie. return false) if the folio is dirty (analogous with iomap's behaviour). Without this, it will say yes to the release of a dirty page by split_huge_page_to_list_to_order(), which will result in the loss of untruncated data in the folio. Without this, the generic/075 and generic/112 xfstests (both fsx-based tests) fail with minimum folio size patches applied[1]. Fixes: c1ec4d7c2e13 ("netfs: Provide invalidate_folio and release_folio calls") Signed-off-by: David Howells <dhowells@redhat.com> cc: Matthew Wilcox (Oracle) <willy@infradead.org> cc: Pankaj Raghav <p.raghav@samsung.com> cc: Jeff Layton <jlayton@kernel.org> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org cc: netfs@lists.linux.dev cc: linux-mm@kvack.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20240815090849.972355-1-kernel@pankajraghav.com/ [1] --- fs/netfs/misc.c | 3 +++ 1 file changed, 3 insertions(+)