diff options
author | NeilBrown <neilb@suse.de> | 2014-08-04 02:24:00 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-08-04 09:22:08 -0400 |
commit | 122a8cda6a9a3594c4737570f5cd81636bcd20cf (patch) | |
tree | 75d8f337b22e59e70d31670a7ebdbd47a8c00412 | |
parent | 50d77739fa1972030daf1c8902404551e49bf232 (diff) |
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: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | net/sunrpc/auth.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 24fcbd23ae6c..383eb919ac0b 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
@@ -630,14 +630,8 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags) | |||
630 | memset(&acred, 0, sizeof(acred)); | 630 | memset(&acred, 0, sizeof(acred)); |
631 | acred.uid = cred->fsuid; | 631 | acred.uid = cred->fsuid; |
632 | acred.gid = cred->fsgid; | 632 | acred.gid = cred->fsgid; |
633 | if (flags & RPCAUTH_LOOKUP_RCU) | 633 | acred.group_info = cred->group_info; |
634 | acred.group_info = rcu_dereference(cred->group_info); | ||
635 | else | ||
636 | acred.group_info = get_group_info(((struct cred *)cred)->group_info); | ||
637 | |||
638 | ret = auth->au_ops->lookup_cred(auth, &acred, flags); | 634 | ret = auth->au_ops->lookup_cred(auth, &acred, flags); |
639 | if (!(flags & RPCAUTH_LOOKUP_RCU)) | ||
640 | put_group_info(acred.group_info); | ||
641 | return ret; | 635 | return ret; |
642 | } | 636 | } |
643 | EXPORT_SYMBOL_GPL(rpcauth_lookupcred); | 637 | EXPORT_SYMBOL_GPL(rpcauth_lookupcred); |