Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2014677pxb; Mon, 8 Mar 2021 11:44:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJywAIzSfrwWvYQhPU0EfgpkUDZBKQyVRrNKhkThZI1YVJ2xDAAyCSlVSQYjQxU8XqVmjm0R X-Received: by 2002:a50:c00b:: with SMTP id r11mr201793edb.35.1615232659855; Mon, 08 Mar 2021 11:44:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615232659; cv=none; d=google.com; s=arc-20160816; b=iqLEt04fWVAVkyHv8aYPKFi+Um1IvGMYyHoi42Vc8Aq2YAdJSrLvWqHWGDSn+w3X4Z 9wgBVJfRTfvrgKJqRWD1NADVtbGsT+u+sRWr+mRIp0wJm8CAsaKBKN+KVl8PmZIh0Nx/ Wcsyd8102HwgtvcKQ7LLf30SgMGKAyXGLwqlS4ef5PMb0dpWvqZTLb/j4/QRwmkjx1xg gKkxuqbNNTaW1kaqgLFREIjK0EYugMpFzw6lioO8D8HvEN7K3z++wa52fk4H2q6UgnXT B7Qaceqeuq+JKyaI/A4QI3ZyWqtZjQZbDjbQS3A95CLztA7/o7jxP2W4MDj2U8GpMUDr 7Bdg== 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=4FAbRmktYERQSyUSsP08Ihp8ePTQsvp43Bq23pcVYKQ=; b=FcgeV8sbPYGu/A5TfLLV4Lo66AAh92Ylzk/PmAaHY2RnFTN/ODLp3krb3bs5ybggic zYtL9/mR3Ighrk/ls608hLaVkwRrGvbZPN7jRlbawKMLzhUo4tbGI9ZtsYiG27Mzw+lW 7vLCyldtU/g2ETsrCWkq2M2Di2Pg7apXrZCnDUQRH+uTfbAL4iF1yC3t8hm9H6EBWxyp 64U6iifma8l9FvXtDpX4ZeiTTaTptZ/B1A0Lo0C/Gjmoc9qcNt9lscp0+mgiezpqPK5o fxaB26CbnbBSmFlmLeFRGRhxCI9vFJtSa48WNGniCEneMwlnPqB9lrCDry2L2bxEqQZz h5wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bmgA8jc6; 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 e24si7436229ejc.739.2021.03.08.11.43.47; Mon, 08 Mar 2021 11:44:19 -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=bmgA8jc6; 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 S230517AbhCHTnM (ORCPT + 99 others); Mon, 8 Mar 2021 14:43:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:51012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbhCHTm5 (ORCPT ); Mon, 8 Mar 2021 14:42:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1979E652B3; Mon, 8 Mar 2021 19:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615232577; bh=8y1DWKatjPA48Z1tsHvNCvxIvoci0f18KkuAVxomkR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bmgA8jc66viJmW0TbhMx6zZ2obE/ndGygJ6APf990OKdTgbur5UWi8r0gRYgLm+Re Znsvq0CyZVq3gnpIYMxfsKX9YCPKtFpul3uX34MsnV14rfyXv4wo1U7ka8vXGtIc8G rnpYjhtna3JUbd8X/mrWO9TY6nQGbOQ+TAFAjh5c4HLk3Nuy1irDYo2kX6rwExqqGT 5RST1X6pNSLaBlPWXISRDsLQ3d2ywMaaVLs7LmQgnruagiNCK4CBwpsIBUq2+ung5F hAxlIzuI6dobUW9yrQl/z5RKWQFzQJhVXBcofJynfAnwN7PA66H756AEG/OlU+pAMk IVS1O/EpK9J4Q== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: Geert Jansen Subject: [PATCH v2 2/5] NFS: Don't gratuitously clear the inode cache when lookup failed Date: Mon, 8 Mar 2021 14:42:52 -0500 Message-Id: <20210308194255.7873-2-trondmy@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308194255.7873-1-trondmy@kernel.org> References: <20210308194255.7873-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 08b162de627f..a91f324cca49 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