Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp994352pxb; Wed, 3 Mar 2021 23:53:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAHSoFzQPRj1DWgEx/bsNgQQOWTobhN+OIwytq0TWwDArIKvf16z3kYqOhVs72peXBSXuK X-Received: by 2002:a17:906:1f93:: with SMTP id t19mr2864623ejr.443.1614844439472; Wed, 03 Mar 2021 23:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614844439; cv=none; d=google.com; s=arc-20160816; b=q1Djy6Kf0YqLQPTbEf/d1v+0HqW14AwFfQpkxyE6MSUUB9kWSNkCcRHs2mK1g3v/gI P4uN6QOa+XbngX024U6p47W+DZ+kFaWyAWp0tnZNW6ETzDHoZyLcBdeykHQH/jVR5Ylq CdupSrdjXkhez9M+NADOL7j7UNtdNPxtJyOpzil6ZffLYforLSMvF5V1HIJ2DlZGu98K L6Ezg93nkq7hGD4yX0pPhjmp6svs/DfnJZK9T8Pg42WtC1EREmEKTn4TRu+xJU/PNFO4 eOftnbbaaONQJq8Smvg/HYeD5tMJ2Q3pO1MRqeSVlJkphVeE3KVa4l/yL5OUthnrCSh5 gbEw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T7+jKIcnEGujYyoefowp+XTmkBOxj5sIdBYITRpxWs0=; b=DIiHWdHH/PipukAzLFL06uhQG70O34A2yIUeq5t3p1zoDiwrmivA+PtiWtndUb6mKp d2xenawm3UBaeHZf8MU2eP9S3ol1ZwTKW9Fg72Hb4zoaTrbKKGlArt415hgFGoRHrtch sbJnmVgzmQr0NlafM3AM0mbN1cIrc3J5O2ipG+96BPaMKa6bXsCgRn/d3LA7vG3X/x9B plAc1mFj9pEtJnXEjBYIpVmOzrxsH9KIZUZ/GElquXRxyzTKHx/8admRoCHSeYn9GQjg 0waQsObCIqTNpTL2wy4smTAHI78zkS92UGWG4jP7vbZxDX8SqTRC4ZmnIKVkPH+WJ85S XekQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Gk/JY9pC"; 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 s13si1500403edc.150.2021.03.03.23.53.37; Wed, 03 Mar 2021 23:53:59 -0800 (PST) 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="Gk/JY9pC"; 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 S1345001AbhCCK6Q (ORCPT + 99 others); Wed, 3 Mar 2021 05:58:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:56560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444005AbhCCE3U (ORCPT ); Tue, 2 Mar 2021 23:29:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8878564EC0; Wed, 3 Mar 2021 04:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614745718; bh=0stP7r4ZoXAMNXgPuZItc5apuDtDXhbakYQ5nIw0v10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gk/JY9pCIpF+oc6tEhkAIL/Jao/GnvTE7m+JmxXowom+YLx70/9J4EV/x+xx8sZ0p WuBXsUCx8VVQG15ut3DAWUlDgyVd11qvnfDsmb3jcXY29YI5SSOxjjRlqC3vizW3co tgUaSCaLFZErxa1lgmw4bzOkUD4FQE+1a6V4E5zpxT0USNPPLA/h0LrXnTu/1EXY5I DqpOMN1+0qbRKDaebSjiAG4jzvNFap/jAF7CH5CNRSYqPWNgUCRYMh5VtdPkFXxtbD 7Ge4BN37sHu/pQph5p3jRbBv7NAyjZR29/UM/ZDfGhA11Ghg22O8Me6D/nAHKleuSn UBJ6Vnxxg/BwA== From: trondmy@kernel.org To: Geert Jansen Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] NFS: Don't gratuitously clear the inode cache when lookup failed Date: Tue, 2 Mar 2021 23:28:36 -0500 Message-Id: <20210303042836.200413-2-trondmy@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210303042836.200413-1-trondmy@kernel.org> References: <20210303042836.200413-1-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust The fact that the lookup revalidation failed, does not mean that the inode contents have changed. Fixes: 5ceb9d7fdaaf ("NFS: Refactor nfs_lookup_revalidate()") Signed-off-by: Trond Myklebust --- fs/nfs/dir.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 6350873cb8bd..deb6ad0622ed 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1444,18 +1444,14 @@ nfs_lookup_revalidate_done(struct inode *dir, struct dentry *dentry, __func__, dentry); return 1; case 0: - if (inode && S_ISDIR(inode->i_mode)) { - /* Purge readdir caches. */ - nfs_zap_caches(inode); - /* - * We can't d_drop the root of a disconnected tree: - * its d_hash is on the s_anon list and d_drop() would hide - * it from shrink_dcache_for_unmount(), leading to busy - * inodes on unmount and further oopses. - */ - if (IS_ROOT(dentry)) - return 1; - } + /* + * We can't d_drop the root of a disconnected tree: + * its d_hash is on the s_anon list and d_drop() would hide + * it from shrink_dcache_for_unmount(), leading to busy + * inodes on unmount and further oopses. + */ + if (inode && IS_ROOT(dentry)) + return 1; dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n", __func__, dentry); return 0; -- 2.29.2