Merge tag 'nfs-for-5.7-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[platform/kernel/linux-starfive.git] / fs / nfs / dir.c
index d729d83..5a331da 100644 (file)
@@ -2516,7 +2516,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)