NFS: Fix up a sparse warning
sparse is warning about an incorrect RCU dereference. fs/nfs/dir.c:2965:56: warning: incorrect type in argument 1 (different address spaces) fs/nfs/dir.c:2965:56: expected struct cred const * fs/nfs/dir.c:2965:56: got struct cred const [noderef] __rcu *const cred Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
029085b894
commit
5e9a7b9c2e
1 changed files with 3 additions and 1 deletions
|
@ -2957,12 +2957,14 @@ static u64 nfs_access_login_time(const struct task_struct *task,
|
||||||
const struct cred *cred)
|
const struct cred *cred)
|
||||||
{
|
{
|
||||||
const struct task_struct *parent;
|
const struct task_struct *parent;
|
||||||
|
const struct cred *pcred;
|
||||||
u64 ret;
|
u64 ret;
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
parent = rcu_dereference(task->real_parent);
|
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;
|
break;
|
||||||
task = parent;
|
task = parent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue