From: Madhuparna Bhowmik Date: Tue, 10 Dec 2019 05:46:39 +0000 (+0530) Subject: nfs: Fix nfs_access_get_cached_rcu() sparse error X-Git-Tag: v5.7-rc1~183^2^2^2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f01eb5d4936f12d57da84cdfbc2a3623e23a7eb;p=thirdparty%2Flinux.git nfs: Fix nfs_access_get_cached_rcu() sparse error This patch fixes the following sparse error: fs/nfs/dir.c:2353:14: error: incompatible types in comparison expression (different address spaces): fs/nfs/dir.c:2353:14: struct list_head [noderef] * fs/nfs/dir.c:2353:14: struct list_head * Signed-off-by: Madhuparna Bhowmik Signed-off-by: Paul E. McKenney --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 1320288ff9ec9..55a29b0d52fcf 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2383,7 +2383,7 @@ static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cre rcu_read_lock(); if (nfsi->cache_validity & NFS_INO_INVALID_ACCESS) goto out; - lh = rcu_dereference(nfsi->access_cache_entry_lru.prev); + lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru)); cache = list_entry(lh, struct nfs_access_entry, lru); if (lh == &nfsi->access_cache_entry_lru || cred_fscmp(cred, cache->cred) != 0)