Commit 4a8c1344dccb848dbcf0edabc8b5c51a8ecf2808
1 parent
c1384c9c4c
Exists in
master
and in
7 other branches
SUNRPC: Add a backpointer from the struct rpc_cred to the rpc_auth
Cleans up an issue whereby rpcsec_gss uses the rpc_clnt->cl_auth. If we want to be able to add several rpc_auths to a single rpc_clnt, then this abuse must go. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Showing 4 changed files with 8 additions and 1 deletions Side-by-side Diff
include/linux/sunrpc/auth.h
... | ... | @@ -30,8 +30,11 @@ |
30 | 30 | /* |
31 | 31 | * Client user credentials |
32 | 32 | */ |
33 | +struct rpc_auth; | |
34 | +struct rpc_credops; | |
33 | 35 | struct rpc_cred { |
34 | 36 | struct hlist_node cr_hash; /* hash chain */ |
37 | + struct rpc_auth * cr_auth; | |
35 | 38 | struct rpc_credops * cr_ops; |
36 | 39 | unsigned long cr_expire; /* when to gc */ |
37 | 40 | atomic_t cr_count; /* ref count */ |
... | ... | @@ -60,6 +63,7 @@ |
60 | 63 | unsigned long expire; /* cache expiry interval */ |
61 | 64 | }; |
62 | 65 | |
66 | +struct rpc_authops; | |
63 | 67 | struct rpc_auth { |
64 | 68 | unsigned int au_cslack; /* call cred size estimate */ |
65 | 69 | /* guess at number of u32's auth adds before |
net/sunrpc/auth_gss/auth_gss.c
... | ... | @@ -386,7 +386,7 @@ |
386 | 386 | gss_refresh_upcall(struct rpc_task *task) |
387 | 387 | { |
388 | 388 | struct rpc_cred *cred = task->tk_msg.rpc_cred; |
389 | - struct gss_auth *gss_auth = container_of(task->tk_client->cl_auth, | |
389 | + struct gss_auth *gss_auth = container_of(cred->cr_auth, | |
390 | 390 | struct gss_auth, rpc_auth); |
391 | 391 | struct gss_cred *gss_cred = container_of(cred, |
392 | 392 | struct gss_cred, gc_base); |
... | ... | @@ -741,6 +741,7 @@ |
741 | 741 | * fail to flag the credential as RPCAUTH_CRED_UPTODATE. |
742 | 742 | */ |
743 | 743 | cred->gc_flags = 0; |
744 | + cred->gc_base.cr_auth = auth; | |
744 | 745 | cred->gc_base.cr_ops = &gss_credops; |
745 | 746 | cred->gc_base.cr_flags = RPCAUTH_CRED_NEW; |
746 | 747 | cred->gc_service = gss_auth->service; |
net/sunrpc/auth_null.c