Message ID | 20230118145652.35953-5-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 9a39bb94d5d8..b98b19ca367c 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2298,12 +2298,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; }