Skip to content

Commit 5e9a7b9

Browse files
author
Trond Myklebust
committed
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>
1 parent 029085b commit 5e9a7b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/nfs/dir.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2957,12 +2957,14 @@ static u64 nfs_access_login_time(const struct task_struct *task,
29572957
const struct cred *cred)
29582958
{
29592959
const struct task_struct *parent;
2960+
const struct cred *pcred;
29602961
u64 ret;
29612962

29622963
rcu_read_lock();
29632964
for (;;) {
29642965
parent = rcu_dereference(task->real_parent);
2965-
if (parent == task || cred_fscmp(parent->cred, cred) != 0)
2966+
pcred = rcu_dereference(parent->cred);
2967+
if (parent == task || cred_fscmp(pcred, cred) != 0)
29662968
break;
29672969
task = parent;
29682970
}

0 commit comments

Comments
 (0)