@@ -521,9 +521,7 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
521
521
case - NFS4ERR_DEADSESSION :
522
522
case - NFS4ERR_SEQ_FALSE_RETRY :
523
523
case - NFS4ERR_SEQ_MISORDERED :
524
- dprintk ("%s ERROR: %d Reset session\n" , __func__ ,
525
- errorcode );
526
- nfs4_schedule_session_recovery (clp -> cl_session , errorcode );
524
+ /* Handled in nfs41_sequence_process() */
527
525
goto wait_on_recovery ;
528
526
#endif /* defined(CONFIG_NFS_V4_1) */
529
527
case - NFS4ERR_FILE_OPEN :
@@ -782,6 +780,7 @@ static int nfs41_sequence_process(struct rpc_task *task,
782
780
struct nfs4_session * session ;
783
781
struct nfs4_slot * slot = res -> sr_slot ;
784
782
struct nfs_client * clp ;
783
+ int status ;
785
784
int ret = 1 ;
786
785
787
786
if (slot == NULL )
@@ -793,8 +792,13 @@ static int nfs41_sequence_process(struct rpc_task *task,
793
792
session = slot -> table -> session ;
794
793
795
794
trace_nfs4_sequence_done (session , res );
795
+
796
+ status = res -> sr_status ;
797
+ if (task -> tk_status == - NFS4ERR_DEADSESSION )
798
+ status = - NFS4ERR_DEADSESSION ;
799
+
796
800
/* Check the SEQUENCE operation status */
797
- switch (res -> sr_status ) {
801
+ switch (status ) {
798
802
case 0 :
799
803
/* Mark this sequence number as having been acked */
800
804
nfs4_slot_sequence_acked (slot , slot -> seq_nr );
@@ -866,6 +870,10 @@ static int nfs41_sequence_process(struct rpc_task *task,
866
870
*/
867
871
slot -> seq_nr = slot -> seq_nr_highest_sent ;
868
872
goto out_retry ;
873
+ case - NFS4ERR_BADSESSION :
874
+ case - NFS4ERR_DEADSESSION :
875
+ case - NFS4ERR_CONN_NOT_BOUND_TO_SESSION :
876
+ goto session_recover ;
869
877
default :
870
878
/* Just update the slot sequence no. */
871
879
slot -> seq_done = 1 ;
@@ -876,8 +884,10 @@ static int nfs41_sequence_process(struct rpc_task *task,
876
884
out_noaction :
877
885
return ret ;
878
886
session_recover :
879
- nfs4_schedule_session_recovery (session , res -> sr_status );
880
- goto retry_nowait ;
887
+ nfs4_schedule_session_recovery (session , status );
888
+ dprintk ("%s ERROR: %d Reset session\n" , __func__ , status );
889
+ nfs41_sequence_free_slot (res );
890
+ goto out ;
881
891
retry_new_seq :
882
892
++ slot -> seq_nr ;
883
893
retry_nowait :
@@ -2188,7 +2198,6 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct
2188
2198
case - NFS4ERR_BAD_HIGH_SLOT :
2189
2199
case - NFS4ERR_CONN_NOT_BOUND_TO_SESSION :
2190
2200
case - NFS4ERR_DEADSESSION :
2191
- nfs4_schedule_session_recovery (server -> nfs_client -> cl_session , err );
2192
2201
return - EAGAIN ;
2193
2202
case - NFS4ERR_STALE_CLIENTID :
2194
2203
case - NFS4ERR_STALE_STATEID :
@@ -7824,6 +7833,15 @@ nfs41_same_server_scope(struct nfs41_server_scope *a,
7824
7833
static void
7825
7834
nfs4_bind_one_conn_to_session_done (struct rpc_task * task , void * calldata )
7826
7835
{
7836
+ struct nfs41_bind_conn_to_session_args * args = task -> tk_msg .rpc_argp ;
7837
+ struct nfs_client * clp = args -> client ;
7838
+
7839
+ switch (task -> tk_status ) {
7840
+ case - NFS4ERR_BADSESSION :
7841
+ case - NFS4ERR_DEADSESSION :
7842
+ nfs4_schedule_session_recovery (clp -> cl_session ,
7843
+ task -> tk_status );
7844
+ }
7827
7845
}
7828
7846
7829
7847
static const struct rpc_call_ops nfs4_bind_one_conn_to_session_ops = {
@@ -8871,8 +8889,6 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf
8871
8889
case - NFS4ERR_BADSESSION :
8872
8890
case - NFS4ERR_DEADSESSION :
8873
8891
case - NFS4ERR_CONN_NOT_BOUND_TO_SESSION :
8874
- nfs4_schedule_session_recovery (clp -> cl_session ,
8875
- task -> tk_status );
8876
8892
break ;
8877
8893
default :
8878
8894
nfs4_schedule_lease_recovery (clp );
0 commit comments