nfs41: Retry delegation return if it failed with session error
authorRicardo Labiaga <Ricardo.Labiaga@netapp.com>
Mon, 7 Dec 2009 14:23:21 +0000 (09:23 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 7 Dec 2009 14:23:21 +0000 (09:23 -0500)
Update nfs4_delegreturn_done() to retry the operation after setting the
NFS4CLNT_SESSION_SETUP bit to indicate the need to reset the session.

Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c

index 96dfff12736d9fda2486526a430a45c285584010..d8c2ceb303d1390ce9dd7873f9c3fd36923afb7b 100644 (file)
@@ -3479,9 +3479,20 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata)
        nfs4_sequence_done(data->res.server, &data->res.seq_res,
                        task->tk_status);
 
-       data->rpc_status = task->tk_status;
-       if (data->rpc_status == 0)
+       switch (task->tk_status) {
+       case -NFS4ERR_STALE_STATEID:
+       case -NFS4ERR_EXPIRED:
+       case 0:
                renew_lease(data->res.server, data->timestamp);
+               break;
+       default:
+               if (nfs4_async_handle_error(task, data->res.server, NULL) ==
+                               -EAGAIN) {
+                       nfs_restart_rpc(task, data->res.server->nfs_client);
+                       return;
+               }
+       }
+       data->rpc_status = task->tk_status;
 }
 
 static void nfs4_delegreturn_release(void *calldata)