nfs: handle NFSv3 -EKEYEXPIRED errors as we would -EJUKEBOX

We're using -EKEYEXPIRED to indicate that a krb5 credcache contains an
expired ticket and that we should have the NFS layer retry the RPC call
instead of returning an error back to the caller. Handle this as we
would an -EJUKEBOX error return.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Jeff Layton 2010-01-07 09:42:04 -05:00 committed by Trond Myklebust
parent 2c6434888c
commit b68d69b8c6

View File

@ -22,14 +22,14 @@
#define NFSDBG_FACILITY NFSDBG_PROC #define NFSDBG_FACILITY NFSDBG_PROC
/* A wrapper to handle the EJUKEBOX error message */ /* A wrapper to handle the EJUKEBOX and EKEYEXPIRED error messages */
static int static int
nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
{ {
int res; int res;
do { do {
res = rpc_call_sync(clnt, msg, flags); res = rpc_call_sync(clnt, msg, flags);
if (res != -EJUKEBOX) if (res != -EJUKEBOX && res != -EKEYEXPIRED)
break; break;
schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME); schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME);
res = -ERESTARTSYS; res = -ERESTARTSYS;
@ -42,8 +42,9 @@ nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
static int static int
nfs3_async_handle_jukebox(struct rpc_task *task, struct inode *inode) nfs3_async_handle_jukebox(struct rpc_task *task, struct inode *inode)
{ {
if (task->tk_status != -EJUKEBOX) if (task->tk_status != -EJUKEBOX && task->tk_status != -EKEYEXPIRED)
return 0; return 0;
if (task->tk_status == -EJUKEBOX)
nfs_inc_stats(inode, NFSIOS_DELAY); nfs_inc_stats(inode, NFSIOS_DELAY);
task->tk_status = 0; task->tk_status = 0;
rpc_restart_call(task); rpc_restart_call(task);