NFSv4.1: Retry CREATE_SESSION on NFS4ERR_DELAY
authorRicardo Labiaga <Ricardo.Labiaga@netapp.com>
Wed, 9 Mar 2011 18:13:44 +0000 (13:13 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 10 Mar 2011 20:04:59 +0000 (15:04 -0500)
Fix bug where we currently retry the EXCHANGEID call again, eventhough
we already have a valid clientid.  Instead, delay and retry the CREATE_SESSION
call.

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

index b07d4e23b8760b1612e69d3a13b5dad62a493a66..d3c705aa71f6a465d0eb7730d5a75d65459218df 100644 (file)
@@ -5028,10 +5028,20 @@ int nfs4_proc_create_session(struct nfs_client *clp)
        int status;
        unsigned *ptr;
        struct nfs4_session *session = clp->cl_session;
+       long timeout = 0;
+       int err;
 
        dprintk("--> %s clp=%p session=%p\n", __func__, clp, session);
 
-       status = _nfs4_proc_create_session(clp);
+       do {
+               status = _nfs4_proc_create_session(clp);
+               if (status == -NFS4ERR_DELAY) {
+                       err = nfs4_delay(clp->cl_rpcclient, &timeout);
+                       if (err)
+                               status = err;
+               }
+       } while (status == -NFS4ERR_DELAY);
+
        if (status)
                goto out;