@@ -2366,6 +2366,8 @@ static int nfs_access_get_cached_rcu(struct inode *inode, struct rpc_cred *cred,
* but do it without locking.
*/
struct nfs_inode *nfsi = NFS_I(inode);
+ const struct cred *cur_cred = current_cred();
+ u64 login_time = nfs_access_login_time(current, cur_cred);
struct nfs_access_entry *cache;
int err = -ECHILD;
struct list_head *lh;
@@ -2380,6 +2382,8 @@ static int nfs_access_get_cached_rcu(struct inode *inode, struct rpc_cred *cred,
cache = NULL;
if (cache == NULL)
goto out;
+ if ((s64)(login_time - cache->timestamp) > 0)
+ goto out;
if (nfs_check_cache_invalid(inode, NFS_INO_INVALID_ACCESS))
goto out;
res->cred = cache->cred;