Commit 122a8cda authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust

SUNRPC: remove all refcounting of groupinfo from rpcauth_lookupcred

current_cred() can only be changed by 'current', and
cred->group_info is never changed.  If a new group_info is
needed, a new 'cred' is created.

Consequently it is always safe to access
   current_cred()->group_info

without taking any further references.
So drop the refcounting and the incorrect rcu_dereference().
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 50d77739
...@@ -630,14 +630,8 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags) ...@@ -630,14 +630,8 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags)
memset(&acred, 0, sizeof(acred)); memset(&acred, 0, sizeof(acred));
acred.uid = cred->fsuid; acred.uid = cred->fsuid;
acred.gid = cred->fsgid; acred.gid = cred->fsgid;
if (flags & RPCAUTH_LOOKUP_RCU) acred.group_info = cred->group_info;
acred.group_info = rcu_dereference(cred->group_info);
else
acred.group_info = get_group_info(((struct cred *)cred)->group_info);
ret = auth->au_ops->lookup_cred(auth, &acred, flags); ret = auth->au_ops->lookup_cred(auth, &acred, flags);
if (!(flags & RPCAUTH_LOOKUP_RCU))
put_group_info(acred.group_info);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(rpcauth_lookupcred); EXPORT_SYMBOL_GPL(rpcauth_lookupcred);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment