Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527912pxf; Mon, 15 Mar 2021 11:33:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8xjJ/3VQBUghrG8Qw849jAIfAQfhOBUYIWcCIEt5+uiVy+MJTSpAk5mT+TmVFEXg7og1z X-Received: by 2002:a17:906:f8d5:: with SMTP id lh21mr25214951ejb.64.1615833197187; Mon, 15 Mar 2021 11:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833197; cv=none; d=google.com; s=arc-20160816; b=gc76lZ/rwJyHfl/mNQRGzfusbq2y2IeZYWKfCHZczym17fAnroLJmezmBhhUSMi6+A KvPnTnQvTm2YByvQZATiVnJoxph1IWRdwHxoZ2fYnmHja0hhWeZhou2jTMNlKHW1nmAr tTpe4xyVl9leEP6R0y0T2Nw+zlqdFh9wmYQnbVGGRIY06nVlbM/amoe2sA6Z+lwD1ipl MLR/HohlFIMbWrd1Ty8TDNGtTy2zYpVnroJ8lRO+oR9XrmarUe3Icvr+w+sR/1S6i/n6 5aPvzptlnXF+LF23De108MpHFc1TyTFcLQHcmwm9NuzkzTlG9pJEYJEVL+/AkdbA9QFK /BRg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2+vX3zl9hAibAkoUeZw3n0cqkOF4YLwiJ7OT7kzEJv0=; b=PoaZTriWiLC4Rff68oUlxRM2yeBN4ZRZN1pYF2acFGgCVsB/FJkIK+o0vF6cP0fKkP 9f9eqOM0sxqVKv1WhVM7krBGYTxTifgIvJaKpD1O4jYP7/w41/16qM+lbdwxTxXqu+uB opvW2NyQYibaha2TxRhg3Uo9ODfN//gv1DLF+k+enoY5Tx+tEMbQAoO9C2mBtM6LScGM e/g0MNhp3f1fqIQzUYB7+r0NRaf47uG5wVbnAV7LEFNqGf5I0uUGVClq84umtpp+LSNs 5q/dzc+msXuJxTTWJ6fmAnOg7EMRi8wOXuxVMnAEC6Tdj8/skCI089CcCJLRhqVcv6UW /GqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=otuduG64; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kl9si7026562ejc.271.2021.03.15.11.32.54; Mon, 15 Mar 2021 11:33:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=otuduG64; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238135AbhCOOnq (ORCPT + 99 others); Mon, 15 Mar 2021 10:43:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:49878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231744AbhCOODe (ORCPT ); Mon, 15 Mar 2021 10:03:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 42C6264EF9; Mon, 15 Mar 2021 14:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817013; bh=JYzkUGQ0gDm67R+Ipi4zTIX8/lDGOVTHQ1Q7xVeXniA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=otuduG64VLGusbW/M/+Gb7I3WC0YTxtJAvK2s/vBVXe4xQXbiOO8JLbU7OjOh2oAh onLbAmLCkE5LO0pp+91Jiv453L4g8njKzLfjgGdknZTfFzn1KOuoWWLuwb/UO6TpYR t0fN+RwoTW9OAxUKZinnh5jLjZud8Q8P9Ppn1DRo= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Anna Schumaker , Sasha Levin Subject: [PATCH 5.10 247/290] NFS: Dont gratuitously clear the inode cache when lookup failed Date: Mon, 15 Mar 2021 14:55:40 +0100 Message-Id: <20210315135550.360726807@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Trond Myklebust [ Upstream commit 47397915ede0192235474b145ebcd81b37b03624 ] 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 Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- 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 c96ae135b80f..c837675cd395 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1245,18 +1245,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.30.1