aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2011-05-03 13:43:03 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-05-11 14:01:33 -0400
commita8a4ae3a899a6c0b4771cc57884800d8b76a6996 (patch)
tree762fa0cc26480ea302d1ade0a03f222fae958565 /fs/nfs/nfs4proc.c
parent9f381a61f58bb6487c93ce2233bb9992f8ea9211 (diff)
NFSv41: Resend on NFS4ERR_RETRY_UNCACHED_REP
Free the slot and resend the RPC with new session <slot#,seq#>. For nfs4_async_handle_error, return -EAGAIN and set the task->tk_status to 0 to restart the async rpc in the rpc_restart_call_prepare state which resets the slot. For nfs4_handle_exception, retrying a call that uses nfs4_call_sync will reset the slot via nfs41_call_sync_prepare. For open/close/lock/locku/delegreturn/layoutcommit/unlink/rename/write cachethis is true, so these operations will not trigger an NFS4ERR_RETRY_UNCACHED_REP. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 69c0f3c5ee7a..cf1b339c3937 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -300,6 +300,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
300 ret = nfs4_delay(server->client, &exception->timeout); 300 ret = nfs4_delay(server->client, &exception->timeout);
301 if (ret != 0) 301 if (ret != 0)
302 break; 302 break;
303 case -NFS4ERR_RETRY_UNCACHED_REP:
303 case -NFS4ERR_OLD_STATEID: 304 case -NFS4ERR_OLD_STATEID:
304 exception->retry = 1; 305 exception->retry = 1;
305 break; 306 break;
@@ -3695,6 +3696,7 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
3695 rpc_delay(task, NFS4_POLL_RETRY_MAX); 3696 rpc_delay(task, NFS4_POLL_RETRY_MAX);
3696 task->tk_status = 0; 3697 task->tk_status = 0;
3697 return -EAGAIN; 3698 return -EAGAIN;
3699 case -NFS4ERR_RETRY_UNCACHED_REP:
3698 case -NFS4ERR_OLD_STATEID: 3700 case -NFS4ERR_OLD_STATEID:
3699 task->tk_status = 0; 3701 task->tk_status = 0;
3700 return -EAGAIN; 3702 return -EAGAIN;
@@ -4844,6 +4846,8 @@ static void nfs4_get_lease_time_done(struct rpc_task *task, void *calldata)
4844 dprintk("%s Retry: tk_status %d\n", __func__, task->tk_status); 4846 dprintk("%s Retry: tk_status %d\n", __func__, task->tk_status);
4845 rpc_delay(task, NFS4_POLL_RETRY_MIN); 4847 rpc_delay(task, NFS4_POLL_RETRY_MIN);
4846 task->tk_status = 0; 4848 task->tk_status = 0;
4849 /* fall through */
4850 case -NFS4ERR_RETRY_UNCACHED_REP:
4847 nfs_restart_rpc(task, data->clp); 4851 nfs_restart_rpc(task, data->clp);
4848 return; 4852 return;
4849 } 4853 }
@@ -5479,6 +5483,8 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf
5479 break; 5483 break;
5480 case -NFS4ERR_DELAY: 5484 case -NFS4ERR_DELAY:
5481 rpc_delay(task, NFS4_POLL_RETRY_MAX); 5485 rpc_delay(task, NFS4_POLL_RETRY_MAX);
5486 /* fall through */
5487 case -NFS4ERR_RETRY_UNCACHED_REP:
5482 return -EAGAIN; 5488 return -EAGAIN;
5483 default: 5489 default:
5484 nfs4_schedule_lease_recovery(clp); 5490 nfs4_schedule_lease_recovery(clp);