Message ID | 20230118145708.35996-4-chengen.du@canonical.com |
---|---|
State | New |
Headers | show |
Series | NFS: client permission error after adding user to permissible group | expand |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 951ec7ebde40..da431e7d18d9 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2354,12 +2354,14 @@ static u64 nfs_access_login_time(const struct task_struct *task, const struct cred *cred) { const struct task_struct *parent; + const struct cred *pcred; u64 ret; rcu_read_lock(); for (;;) { parent = rcu_dereference(task->real_parent); - if (parent == task || cred_fscmp(parent->cred, cred) != 0) + pcred = rcu_dereference(parent->cred); + if (parent == task || cred_fscmp(pcred, cred) != 0) break; task = parent; }