RPC: Instead of setting a flag (RPCAUTH_CRED_DEAD) in the cred to indicate failure of an upcall to get a gss context for that cred, set the status of waiting tasks to indicate failure. This solves problems e.g. with creds with the CRED_DEAD flag set never being refreshed, which caused krb5 mounts to fail after the context used to do RENEWS expired. Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- linux-2.6.9-rc2-bfields/net/sunrpc/auth_gss/auth_gss.c | 4 +++- linux-2.6.9-rc2-bfields/net/sunrpc/clnt.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff -puN net/sunrpc/auth_gss/auth_gss.c~gss_downcall_error_fix net/sunrpc/auth_gss/auth_gss.c --- linux-2.6.9-rc2/net/sunrpc/auth_gss/auth_gss.c~gss_downcall_error_fix 2004-09-14 11:09:38.000000000 -0400 +++ linux-2.6.9-rc2-bfields/net/sunrpc/auth_gss/auth_gss.c 2004-09-14 11:09:38.000000000 -0400 @@ -480,12 +480,14 @@ gss_pipe_downcall(struct file *filp, con if (!cred) goto err; if (gss_err) - cred->cr_flags |= RPCAUTH_CRED_DEAD; + cred->cr_flags &= ~RPCAUTH_CRED_UPTODATE; else gss_cred_set_ctx(cred, ctx); spin_lock(&gss_auth->lock); gss_msg = __gss_find_upcall(gss_auth, acred.uid); if (gss_msg) { + if (gss_err) + gss_msg->msg.errno = -EACCES; __gss_unhash_msg(gss_msg); spin_unlock(&gss_auth->lock); gss_release_msg(gss_msg); diff -puN net/sunrpc/clnt.c~gss_downcall_error_fix net/sunrpc/clnt.c --- linux-2.6.9-rc2/net/sunrpc/clnt.c~gss_downcall_error_fix 2004-09-14 11:09:38.000000000 -0400 +++ linux-2.6.9-rc2-bfields/net/sunrpc/clnt.c 2004-09-14 11:09:38.000000000 -0400 @@ -928,7 +928,7 @@ call_refreshresult(struct rpc_task *task task->tk_action = call_reserve; if (status >= 0 && rpcauth_uptodatecred(task)) return; - if (rpcauth_deadcred(task)) { + if (status == -EACCES) { rpc_exit(task, -EACCES); return; } _