From patchwork Mon Sep 23 15:07: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: 13809700 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 4092CCF9C72 for ; Mon, 23 Sep 2024 15:08:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B36B16B0085; Mon, 23 Sep 2024 11:08:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE7246B0088; Mon, 23 Sep 2024 11:08:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9ADF16B0089; Mon, 23 Sep 2024 11:08:28 -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 77A376B0085 for ; Mon, 23 Sep 2024 11:08:28 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 01C371C6BAC for ; Mon, 23 Sep 2024 15:08:27 +0000 (UTC) X-FDA: 82596334296.11.36D3525 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 38071160018 for ; Mon, 23 Sep 2024 15:08:26 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Cy5T7kp4; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.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=1727104010; a=rsa-sha256; cv=none; b=Z7nTFoEMuAZqGhJk7YbQzgnwzUV1b5jAJP5xoqtK5XaLQ9sxjgR7fTBDrlc1W7poty8S+O FuvnFivyTO0iu39j9SYkIYbD9brT8H8T9o7DSTjN1Gq+48rEw9Z9jEHGFG22MX7KdnjO7J zCnmHdsYPCdRVAJnCGQIDCDeRrpH5L8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Cy5T7kp4; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.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=1727104010; 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=UHKFm+zddtgJAu8raP8xj5T/wroKl8vpea/DCvZ5VL0=; b=Dr57aDrNQeuQ8/PSb4jsD+3U08R76ofzj+OsMdp6apP8X1S3dv3Z/vJnDfYuKISUfAN5D5 voLeyYiCzF9Diu9dx55TGRPYycRke1PnWjnVYQgNEq6JRAVXfrooRvK20424PejR8/2byi oyRDlJbKrjop7cnqVTIg2qcOZ1Eb5Ls= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727104105; 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=UHKFm+zddtgJAu8raP8xj5T/wroKl8vpea/DCvZ5VL0=; b=Cy5T7kp43j6ZIX0rZTJf/xV3Y4iWo8mFqNR30ZEODUTXef1k+g0I2P6Sio3g6U0LEpZY15 vC91V/1O52xoupf4nkNJVIb1QsOo0bdp0WvpOlEsfCNt+GNx9aLXMKm7tz00MTvvgyvWqW OT1U1EairVBLsGPIu1bUT/Jep08j+J4= 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-439-YwYfIXcXPKSEJj725uT1xQ-1; Mon, 23 Sep 2024 11:08:20 -0400 X-MC-Unique: YwYfIXcXPKSEJj725uT1xQ-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 59BFD18E6A7E; Mon, 23 Sep 2024 15:08:18 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.145]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9EE911954190; Mon, 23 Sep 2024 15:08:06 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Marc Dionne Cc: David Howells , Paulo Alcantara , 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, kernel test robot Subject: [PATCH 1/8] netfs: Fix mtime/ctime update for mmapped writes Date: Mon, 23 Sep 2024 16:07:45 +0100 Message-ID: <20240923150756.902363-2-dhowells@redhat.com> In-Reply-To: <20240923150756.902363-1-dhowells@redhat.com> References: <20240923150756.902363-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 38071160018 X-Stat-Signature: mfcxsrmcq1funt39moz8qu59f5f89ns6 X-Rspam-User: X-HE-Tag: 1727104106-509754 X-HE-Meta: U2FsdGVkX1+V06WnE9zGvr/Qd0eShcDKDUy/hvJIb2GC9B3aX44MMPPfXXawmRQktoTnCWxmjJEIQsnrvJ/3OKYBRjXH9Xm1Eeot0eHqWSNhVzSnkKEcDa2v0DhJPIlBiHT+XvTfynw0FFGBOP+zSTBETI1VyjTvArOhAgjwjOj/wiAb8RxmBw2vDCgdSAigxrF9jDIow/rCHbuFKLWSB666WBpdh4xLFPziJhesVTESpQ655Lqu4ywc4E8sMSp/yF0U6D6Ib4Po40ck4M+1k8lq6+Pqe0kXU9e0YMxC8QwBm/QXNhKaDEUcoG1arss5KAe1nAa33Ls3kV4b+NOhLJJM/Q4F9YT4lqnXd7FkipWeCD1XyXxF5u/k8gEwbmouDXdKqEDsobp4YhRbwIa9j3Jutp5YSJaddjc3A86zvaXLUWjv+CLzV3KXH7jodsxYQY5Z5D343P9ekY6HbwEtO5PyEwQqVGrSVNk76prWkMAEyvW5f5MZywc4eq17zIGcrxpW5yn4qqM8/+1C9/TYrppc0/xb+/2CmDmCPCi50W09p40ujLguvEvYIZoWQhlUXOWn65dVUBuZ8r0782AN/xzIAw/kMIcrNpDgdbw/op0YYeuzVDZ/bdWoAln37jGuH4oqYYpVQm3Ti7D73KNL6AafcXZsbLeJGxMXkOgNUW536jnvJ6yBfYQJp3LoeWHqtLwgvrG0Hgy1pYwNM0KPuAsBJt0a4WYHG7ADWEcpquNRs7T2aP4jl9lG///wNje8/57q0LFZQy0MocAM8eqPvJly5tF4at8bURvxJENqH02nNeBVdk37QUJax2zQSOje/W6B9BNuEm+MU6ETzvdNm+Y58j2XTTsCPsbrNQe80UYlri6AkvE3Sscdr+sXfLcnuiBbx3wcGoJNiu5QB6wZ1wq2niUfUzSIIcVRpn/RnpeftUaX5SXb5EhKxAbTdcSi5elPpgGY8g3LBBB1/w4 pdHwZgbM Pu4BQ7bIYnm1Uu9lXz471ZK5VMy3gGAMG3UToE/4EqKMjbF36kWxAq9aJZKh35dR691c+6vORACEl/g9bUHTH+Y8stNpay2A7n9OX77NKNVFVxjY861hTrWvYO4NsqqgAAtI2XIEvvtgaH0d7BY6AKe9IkduN2pjzsceBqkUyoIaXn9zKE3UvaPjUGOXOlaU2h/KRaMISsnwoZugbkS6YJcZF/Ggzs91rxw/XYdI1QOQevVyPNHAnBW5dkEs7QjjVr1nRpffHiK9Ra4xZjAlf74WthUxPAqBPE36Qb6RvqvtBLBJNoPyj2u5znb4jbzHgcasPqRbjYoO75aNXS5eIzez6K3cdANqDwT9N8K2mr5/j8CpdLZx2a30+vG9sCWX3NiAU3dQjWMbp71muevu1U+oblIcDUjoj4DM89B3XwXawIQsRJq3h3N6HuZ2ORLb3Vzf2Rq0/1Hr8YFXN6FyahbmvEbLC47580WHrupqpTPkf6ic= 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: The cifs flag CIFS_INO_MODIFIED_ATTR, which indicates that the mtime and ctime need to be written back on close, got taken over by netfs as NETFS_ICTX_MODIFIED_ATTR to avoid the need to call a function pointer to set it. The flag gets set correctly on buffered writes, but doesn't get set by netfs_page_mkwrite(), leading to occasional failures in generic/080 and generic/215. Fix this by setting the flag in netfs_page_mkwrite(). Fixes: 73425800ac94 ("netfs, cifs: Move CIFS_INO_MODIFIED_ATTR to netfs_inode") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202409161629.98887b2-oliver.sang@intel.com Signed-off-by: David Howells cc: Jeff Layton cc: Steve French cc: Paulo Alcantara cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/netfs/buffered_write.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index d7eae597e54d..b3910dfcb56d 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -552,6 +552,7 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr trace_netfs_folio(folio, netfs_folio_trace_mkwrite); netfs_set_group(folio, netfs_group); file_update_time(file); + set_bit(NETFS_ICTX_MODIFIED_ATTR, &ictx->flags); if (ictx->ops->post_modify) ictx->ops->post_modify(inode); ret = VM_FAULT_LOCKED;