diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-11 10:31:12 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-11 10:31:12 -0500 |
commit | 85563073741bd7935a6900d567ddaf907192270d (patch) | |
tree | 5d219f4fa3e9c60e5f20999cb7b5bc75632d1e92 /fs/nfs/nfs4proc.c | |
parent | 7ce0171d4f78992184faed87ea897d730b972965 (diff) |
NFSv4.1: Handle NFS4ERR_BADSLOT errors correctly
Most (all) NFS4ERR_BADSLOT errors are due to the client failing to
respect the server's sr_highest_slotid limit. This mainly happens
due to reordered RPC requests.
The way to handle it is simply to drop the slot that we're using,
and retry using the new highest_slotid limits.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 92bd799eee01..a4692e97bc19 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -422,6 +422,7 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * | |||
422 | struct nfs4_slot *slot; | 422 | struct nfs4_slot *slot; |
423 | unsigned long timestamp; | 423 | unsigned long timestamp; |
424 | struct nfs_client *clp; | 424 | struct nfs_client *clp; |
425 | int ret = 1; | ||
425 | 426 | ||
426 | /* | 427 | /* |
427 | * sr_status remains 1 if an RPC level error occurred. The server | 428 | * sr_status remains 1 if an RPC level error occurred. The server |
@@ -462,6 +463,16 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * | |||
462 | slot->slot_nr, | 463 | slot->slot_nr, |
463 | slot->seq_nr); | 464 | slot->seq_nr); |
464 | goto out_retry; | 465 | goto out_retry; |
466 | case -NFS4ERR_BADSLOT: | ||
467 | /* | ||
468 | * The slot id we used was probably retired. Try again | ||
469 | * using a different slot id. | ||
470 | */ | ||
471 | if (rpc_restart_call_prepare(task)) { | ||
472 | task->tk_status = 0; | ||
473 | ret = 0; | ||
474 | } | ||
475 | break; | ||
465 | default: | 476 | default: |
466 | /* Just update the slot sequence no. */ | 477 | /* Just update the slot sequence no. */ |
467 | ++slot->seq_nr; | 478 | ++slot->seq_nr; |
@@ -470,7 +481,7 @@ out: | |||
470 | /* The session may be reset by one of the error handlers. */ | 481 | /* The session may be reset by one of the error handlers. */ |
471 | dprintk("%s: Error %d free the slot \n", __func__, res->sr_status); | 482 | dprintk("%s: Error %d free the slot \n", __func__, res->sr_status); |
472 | nfs41_sequence_free_slot(res); | 483 | nfs41_sequence_free_slot(res); |
473 | return 1; | 484 | return ret; |
474 | out_retry: | 485 | out_retry: |
475 | if (!rpc_restart_call(task)) | 486 | if (!rpc_restart_call(task)) |
476 | goto out; | 487 | goto out; |