NFSv4.1: Handle errors in nfs4_bind_conn_to_session
[platform/adaptation/renesas_rcar/renesas_kernel.git] / fs / nfs / nfs4state.c
index 1587840..d685fd4 100644 (file)
@@ -1779,7 +1779,26 @@ static int nfs4_recall_slot(struct nfs_client *clp)
 
 static int nfs4_bind_conn_to_session(struct nfs_client *clp)
 {
-       return nfs4_proc_bind_conn_to_session(clp);
+       struct rpc_cred *cred;
+       int ret;
+
+       nfs4_begin_drain_session(clp);
+       cred = nfs4_get_exchange_id_cred(clp);
+       ret = nfs4_proc_bind_conn_to_session(clp, cred);
+       if (cred)
+               put_rpccred(cred);
+       clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state);
+       switch (ret) {
+       case 0:
+               break;
+       case -NFS4ERR_DELAY:
+               ssleep(1);
+               set_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state);
+               break;
+       default:
+               return nfs4_recovery_handle_error(clp, ret);
+       }
+       return 0;
 }
 #else /* CONFIG_NFS_V4_1 */
 static int nfs4_reset_session(struct nfs_client *clp) { return 0; }
@@ -1849,6 +1868,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
                        status = nfs4_bind_conn_to_session(clp);
                        if (status < 0)
                                goto out_error;
+                       continue;
                }
 
                /* First recover reboot state... */