Message ID | 20230121142549.37283-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 691ad507841c..881a8301ccac 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2910,12 +2910,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; }