Skip to content

Commit 4739791

Browse files
Trond Myklebustamschuma-ntap
authored andcommitted
NFS: Don't gratuitously clear the inode cache when lookup failed
The fact that the lookup revalidation failed, does not mean that the inode contents have changed. Fixes: 5ceb9d7 ("NFS: Refactor nfs_lookup_revalidate()") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 82e7ca1 commit 4739791

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

fs/nfs/dir.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,18 +1444,14 @@ nfs_lookup_revalidate_done(struct inode *dir, struct dentry *dentry,
14441444
__func__, dentry);
14451445
return 1;
14461446
case 0:
1447-
if (inode && S_ISDIR(inode->i_mode)) {
1448-
/* Purge readdir caches. */
1449-
nfs_zap_caches(inode);
1450-
/*
1451-
* We can't d_drop the root of a disconnected tree:
1452-
* its d_hash is on the s_anon list and d_drop() would hide
1453-
* it from shrink_dcache_for_unmount(), leading to busy
1454-
* inodes on unmount and further oopses.
1455-
*/
1456-
if (IS_ROOT(dentry))
1457-
return 1;
1458-
}
1447+
/*
1448+
* We can't d_drop the root of a disconnected tree:
1449+
* its d_hash is on the s_anon list and d_drop() would hide
1450+
* it from shrink_dcache_for_unmount(), leading to busy
1451+
* inodes on unmount and further oopses.
1452+
*/
1453+
if (inode && IS_ROOT(dentry))
1454+
return 1;
14591455
dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n",
14601456
__func__, dentry);
14611457
return 0;

0 commit comments

Comments
 (0)