NFS: Do not flush the readdir cache in nfs_dentry_iput()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 2 Oct 2021 23:04:59 +0000 (19:04 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Oct 2021 00:49:07 +0000 (20:49 -0400)
The original premise in commit 83672d392f7b ("NFS: Fix directory caching
problem - with test case and patch.") was that readdirplus was caching
attribute information and replaying it later. This is no longer the
case.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/dir.c

index 3fafecdb20708adf020554ca1f34da4ae11fadbe..210c5945ac2bc96da43ffd8bd260f22edd6bd9c7 100644 (file)
@@ -1727,10 +1727,6 @@ static void nfs_drop_nlink(struct inode *inode)
  */
 static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
 {
-       if (S_ISDIR(inode->i_mode))
-               /* drop any readdir cache as it could easily be old */
-               nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA);
-
        if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
                nfs_complete_unlink(dentry, inode);
                nfs_drop_nlink(inode);