Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2429220pxb; Sat, 2 Oct 2021 17:13:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylxx1uoVwtTvh28n8a1VIoD7jywfvfmdLkgi649z8dnW0HJ5ZXN8AqlBltB8wxMt8lSImZ X-Received: by 2002:a17:90b:4a90:: with SMTP id lp16mr9731772pjb.137.1633219999165; Sat, 02 Oct 2021 17:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633219999; cv=none; d=google.com; s=arc-20160816; b=vV9uol+VGxfVTLQQlX/kub7ibsPH+otgIuDGfkamUI/LxAcbsEj5mzsS6izUtoOnze WE9UawkAwDCa9f0Cpw98nbnQuGKGx0ZOUXh5/aMCHUTjTgQvyfypXgeVccSZBaWm5Rn8 pwDbums4SQJvWBuyDOCX3Q4lHT8PvWXP2vBxZm3aRvtGWzMzDdViPYlQvMwdkC1l4Zo6 VSB4daGmUJtja1DPYVYLRO4ZVbj1RzVYnPxVUsiiCM3OA2qG/nv3hUTDzGYTrsanV/ba CpKRjOZ6M+IUa0m0Asi6x/X5X5aSQMx/1dg+Arm+KGqzHiEqI8xpz4Y2qfNu+7vxLu3z tbRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=t/d9vGNOUCcU3AEkewC7iGr/puJUAwcQGWRTQJMQwjM=; b=DNUTHV43XDvHPKS+X/q22SsweZ/mm6A9bDsj+FI+wUfucI5wKy0F6lLrdpxPEhvFZj 2Feg5/1dhIOHJplmBDND8d2YOqazDqt5cX9JTIRpuyvgg6ZOysimV9FrtQyyS9C8zVL8 gieyN+zjECZbvVR+MWRqx6NAoMNvNWPO0zAsefVYGV9RmCBBZn25Cqb0lJxwWh3VJT48 J8nN3vPYmRhfGoysPUb346NxHJIDhjxr5sigBve7BwihxMFqne0Xso4yLzqU/vYTIvi5 tiQw9AUtdXBvEwfujTMcjIT9NgkVVyRTmqw2eDg73moQI8KTyNRpuFdytCKf9J4QExkT 3tSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Xt/MznQi"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si18505747plk.438.2021.10.02.17.13.06; Sat, 02 Oct 2021 17:13:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Xt/MznQi"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234301AbhJCAKL (ORCPT + 99 others); Sat, 2 Oct 2021 20:10:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:54758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234236AbhJCAKK (ORCPT ); Sat, 2 Oct 2021 20:10:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3682361AA9 for ; Sun, 3 Oct 2021 00:08:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633219704; bh=mDFl0IAuVfb1sHEObHVutH+9MmnJqyoNzljR8RYwlbI=; h=From:To:Subject:Date:From; b=Xt/MznQiuZz7zBWdk4E7u+20EhjqLskf5Ci+2vYX0Ox8Chm6uGtaz8cVqxfsx2uxw 8aCj+mggECjwAGWZImIFVVCU5/D4RNeHQDYFWEm+5qQ3Tsdn19bGEWMOjkdXGCNna8 AdXbe8Kc7HKeZ1mmkrFaxVfIhAS+yJ5Dds3K6VXD7zWaCqtuV9N9kOoVJiNG7RQgrK mC2y4FMuXAxfNSqJam/QgqKnGj0IRiZbzcTORLZNbWxTnMWHEnl6BHiov36BHJPRkz c7keas5yGmTfV50/IBmErSCmoA9UNbMWNHaQpSxNL8HBH85bjsL6BvhyN+aMuTRlZF 2ILo38Ry9K0QQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH] NFS: Remove unnecessary page cache invalidations Date: Sat, 2 Oct 2021 20:08:23 -0400 Message-Id: <20211003000823.65728-1-trondmy@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Remove cache invalidations that are already covered by change attribute updates. Signed-off-by: Trond Myklebust --- fs/nfs/inode.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index dcb885b7ad73..3bd0ae438663 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1451,8 +1451,6 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) && (fattr->valid & NFS_ATTR_FATTR_MTIME) && timespec64_equal(&ts, &fattr->pre_mtime)) { inode->i_mtime = fattr->mtime; - if (S_ISDIR(inode->i_mode)) - nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); } if ((fattr->valid & NFS_ATTR_FATTR_PRESIZE) && (fattr->valid & NFS_ATTR_FATTR_SIZE) @@ -2162,11 +2160,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) save_cache_validity & NFS_INO_INVALID_OTHER; if (fattr->valid & NFS_ATTR_FATTR_NLINK) { - if (inode->i_nlink != fattr->nlink) { - if (S_ISDIR(inode->i_mode)) - invalid |= NFS_INO_INVALID_DATA; + if (inode->i_nlink != fattr->nlink) set_nlink(inode, fattr->nlink); - } } else if (fattr_supported & NFS_ATTR_FATTR_NLINK) nfsi->cache_validity |= save_cache_validity & NFS_INO_INVALID_NLINK; -- 2.31.1