Skip to contentSkip to conversation

NFSv41: Resend on NFS4ERR_RETRY_UNCACHED_REP

PATCH Superseded [email protected] 2 participants 3 messages May 3, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSv41: Resend on NFS4ERR_RETRY_UNCACHED_REP

From: Andy Adamson <[email protected]>

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.

---
 fs/nfs/nfs4proc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/nfs/nfs4proc.c +2 -0
index b8e1ac6..01d70dd 100644
@@ -300,6 +300,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
 			ret = nfs4_delay(server->client, &exception->timeout);
 			if (ret != 0)
 				break;
+		case -NFS4ERR_RETRY_UNCACHED_REP:
 		case -NFS4ERR_OLD_STATEID:
 			exception->retry = 1;
 			break;
@@ -3677,6 +3678,7 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
 			rpc_delay(task, NFS4_POLL_RETRY_MAX);
 			task->tk_status = 0;
 			return -EAGAIN;
+		case -NFS4ERR_RETRY_UNCACHED_REP:
 		case -NFS4ERR_OLD_STATEID:
 			task->tk_status = 0;
 			return -EAGAIN;
Signature · 1 line
1.7.3.1
#1 lore raw
Quoted 29 lines · On Mon, 2011-05-02 at 21:54 -0400, [email protected] wrote:

From: Andy Adamson <[email protected]>

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.

---
 fs/nfs/nfs4proc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/nfs/nfs4proc.c +1 -0
index b8e1ac6..01d70dd 100644
@@ -300,6 +300,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
 			ret = nfs4_delay(server->client, &exception->timeout);
 			if (ret != 0)
 				break;
+		case -NFS4ERR_RETRY_UNCACHED_REP:
 		case -NFS4ERR_OLD_STATEID:
 			exception->retry = 1;
 			break;

fs/nfs/nfs4proc.c nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, · line 3684

Quoted 7 lines
fs/nfs/nfs4proc.c +1 -0
@@ -3677,6 +3678,7 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
 			rpc_delay(task, NFS4_POLL_RETRY_MAX);
 			task->tk_status = 0;
 			return -EAGAIN;
+		case -NFS4ERR_RETRY_UNCACHED_REP:
 		case -NFS4ERR_OLD_STATEID:
 			task->tk_status = 0;
 			return -EAGAIN;

Looks good... Do we need handlers for this in things like 'reclaim_complete_done()' and 'nfs41_sequence_handle_errors()'?

I'm assuming that all the stateful operations such as open/close/... set the cache reply flag and so don't need it?

Signature · 6 lines
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com
#2 lore raw
Quoted 32 lines · Trond Myklebust
Quoted 31 lines · On Mon, 2011-05-02 at 21:54 -0400, [email protected] wrote:

From: Andy Adamson <[email protected]>

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.

---
fs/nfs/nfs4proc.c | 2 ++

1 files changed, 2 insertions(+), 0 deletions(-)
fs/nfs/nfs4proc.c +1 -0
index b8e1ac6..01d70dd 100644
@@ -300,6 +300,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
 			ret = nfs4_delay(server->client, &exception->timeout);
 			if (ret != 0)
 				break;
+		case -NFS4ERR_RETRY_UNCACHED_REP:
 		case -NFS4ERR_OLD_STATEID:
 			exception->retry = 1;
 			break;
@@ -3677,6 +3678,7 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
 			rpc_delay(task, NFS4_POLL_RETRY_MAX);
 			task->tk_status = 0;
Quoted 8 lines

fs/nfs/nfs4proc.c nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, · line 3684

Quoted 5 lines
fs/nfs/nfs4proc.c +1 -0
 			return -EAGAIN;
+		case -NFS4ERR_RETRY_UNCACHED_REP:
 		case -NFS4ERR_OLD_STATEID:
 			task->tk_status = 0;
 			return -EAGAIN;

Looks good... Do we need handlers for this in things like 'reclaim_complete_done()' and 'nfs41_sequence_handle_errors()'?

We probably do. I'll check for coverage.

Quoted 3 lines

I'm assuming that all the stateful operations such as open/close/... set the cache reply flag and so don't need it?

Yes - and I'll double check.

-->Andy

Quoted 9 lines
Signature · 7 lines
-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com