From: Trond Myklebust Date: Fri, 17 Dec 2021 20:36:55 +0000 (-0500) Subject: NFSv4: Just don't cache negative dentries on case insensitive servers X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=98ca3ee60b9e4b039cc3ef21a169e775afa9bd0c;p=linux.git 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 Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 9883f72fdb6fa..7ebfe4e3cf852 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -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); }