diff -ru b/include/linux/sunrpc/auth.h c/include/linux/sunrpc/auth.h --- b/include/linux/sunrpc/auth.h 2005-01-30 16:21:29.000000000 +0100 +++ c/include/linux/sunrpc/auth.h 2005-01-30 16:23:24.000000000 +0100 @@ -122,10 +122,7 @@ void rpcauth_destroy(struct rpc_auth *); struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); -struct rpc_cred * rpcauth_bindcred(struct rpc_task *); -void rpcauth_holdcred(struct rpc_task *); void put_rpccred(struct rpc_cred *); -void rpcauth_unbindcred(struct rpc_task *); u32 * rpcauth_marshcred(struct rpc_task *, u32 *); u32 * rpcauth_checkverf(struct rpc_task *, u32 *); int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, u32 *data, void *obj); diff -ru b/net/sunrpc/auth.c c/net/sunrpc/auth.c --- b/net/sunrpc/auth.c 2005-01-30 16:21:29.000000000 +0100 +++ c/net/sunrpc/auth.c 2005-01-30 16:23:24.000000000 +0100 @@ -270,37 +270,6 @@ return ret; } -struct rpc_cred * -rpcauth_bindcred(struct rpc_task *task) -{ - struct rpc_auth *auth = task->tk_auth; - struct auth_cred acred; - struct rpc_cred *ret; - - get_group_info(current->group_info); - acred.uid = current->fsuid; - acred.gid = current->fsgid; - acred.group_info = current->group_info; - - dprintk("RPC: %4d looking up %s cred\n", - task->tk_pid, task->tk_auth->au_ops->au_name); - task->tk_msg.rpc_cred = rpcauth_lookup_credcache(auth, &acred, task->tk_flags); - if (task->tk_msg.rpc_cred == 0) - task->tk_status = -ENOMEM; - ret = task->tk_msg.rpc_cred; - put_group_info(current->group_info); - return ret; -} - -void -rpcauth_holdcred(struct rpc_task *task) -{ - dprintk("RPC: %4d holding %s cred %p\n", - task->tk_pid, task->tk_auth->au_ops->au_name, task->tk_msg.rpc_cred); - if (task->tk_msg.rpc_cred) - get_rpccred(task->tk_msg.rpc_cred); -} - void put_rpccred(struct rpc_cred *cred) { @@ -319,19 +288,6 @@ spin_unlock(&rpc_credcache_lock); } -void -rpcauth_unbindcred(struct rpc_task *task) -{ - struct rpc_auth *auth = task->tk_auth; - struct rpc_cred *cred = task->tk_msg.rpc_cred; - - dprintk("RPC: %4d releasing %s cred %p\n", - task->tk_pid, auth->au_ops->au_name, cred); - - put_rpccred(cred); - task->tk_msg.rpc_cred = NULL; -} - u32 * rpcauth_marshcred(struct rpc_task *task, u32 *p) { diff -ru b/net/sunrpc/clnt.c c/net/sunrpc/clnt.c --- b/net/sunrpc/clnt.c 2005-01-30 16:21:29.000000000 +0100 +++ c/net/sunrpc/clnt.c 2005-01-30 16:26:06.000000000 +0100 @@ -425,11 +425,15 @@ { task->tk_msg = *msg; task->tk_flags |= flags; - /* Bind the user cred */ - if (task->tk_msg.rpc_cred != NULL) { - rpcauth_holdcred(task); - } else - rpcauth_bindcred(task); + + if (task->tk_msg.rpc_cred) { + /* we copied msg->rpc_cred, hold it */ + get_rpccred(task->tk_msg.rpc_cred); + } else { + task->tk_msg.rpc_cred = rpcauth_lookupcred(task->tk_auth, task->tk_flags); + if (task->tk_msg.rpc_cred == NULL) + task->tk_status = -ENOMEM; + } if (task->tk_status == 0) task->tk_action = call_start; Only in c/net/sunrpc: clnt.c.orig diff -ru b/net/sunrpc/sched.c c/net/sunrpc/sched.c --- b/net/sunrpc/sched.c 2005-01-30 16:21:29.000000000 +0100 +++ c/net/sunrpc/sched.c 2005-01-30 16:23:24.000000000 +0100 @@ -979,8 +979,10 @@ /* Release resources */ if (task->tk_rqstp) xprt_release(task); - if (task->tk_msg.rpc_cred) - rpcauth_unbindcred(task); + if (task->tk_msg.rpc_cred) { + put_rpccred(task->tk_msg.rpc_cred); + task->tk_msg.rpc_cred = NULL; + } rpc_free(task); if (task->tk_client) { rpc_release_client(task->tk_client);