NFSv4: Just don't cache negative dentries on case insensitive servers

If the directory contents change, we cannot rely on the negative dentry
being cacheable.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Trond Myklebust 2021-12-17 15:36:55 -05:00 committed by Anna Schumaker
parent 1ab5be4ac5
commit 98ca3ee60b

View File

@ -1436,6 +1436,9 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,
return 0;
if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG)
return 1;
/* Case insensitive server? Revalidate negative dentries */
if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE))
return 1;
return !nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU);
}