@@ -559,15 +559,10 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
559
559
{
560
560
struct nfs4_session * session ;
561
561
struct nfs4_slot_table * tbl ;
562
+ struct nfs4_slot * slot = res -> sr_slot ;
562
563
bool send_new_highest_used_slotid = false;
563
564
564
- if (!res -> sr_slot ) {
565
- /* just wake up the next guy waiting since
566
- * we may have not consumed a slot after all */
567
- dprintk ("%s: No slot\n" , __func__ );
568
- return ;
569
- }
570
- tbl = res -> sr_slot -> table ;
565
+ tbl = slot -> table ;
571
566
session = tbl -> session ;
572
567
573
568
spin_lock (& tbl -> slot_tbl_lock );
@@ -577,11 +572,11 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
577
572
if (tbl -> highest_used_slotid > tbl -> target_highest_slotid )
578
573
send_new_highest_used_slotid = true;
579
574
580
- if (nfs41_wake_and_assign_slot (tbl , res -> sr_slot )) {
575
+ if (nfs41_wake_and_assign_slot (tbl , slot )) {
581
576
send_new_highest_used_slotid = false;
582
577
goto out_unlock ;
583
578
}
584
- nfs4_free_slot (tbl , res -> sr_slot );
579
+ nfs4_free_slot (tbl , slot );
585
580
586
581
if (tbl -> highest_used_slotid != NFS4_NO_SLOT )
587
582
send_new_highest_used_slotid = false;
@@ -595,16 +590,17 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
595
590
int nfs41_sequence_done (struct rpc_task * task , struct nfs4_sequence_res * res )
596
591
{
597
592
struct nfs4_session * session ;
598
- struct nfs4_slot * slot ;
593
+ struct nfs4_slot * slot = res -> sr_slot ;
599
594
struct nfs_client * clp ;
600
595
bool interrupted = false;
601
596
int ret = 1 ;
602
597
598
+ if (slot == NULL )
599
+ goto out_noaction ;
603
600
/* don't increment the sequence number if the task wasn't sent */
604
601
if (!RPC_WAS_SENT (task ))
605
602
goto out ;
606
603
607
- slot = res -> sr_slot ;
608
604
session = slot -> table -> session ;
609
605
610
606
if (slot -> interrupted ) {
@@ -679,6 +675,7 @@ int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res)
679
675
/* The session may be reset by one of the error handlers. */
680
676
dprintk ("%s: Error %d free the slot \n" , __func__ , res -> sr_status );
681
677
nfs41_sequence_free_slot (res );
678
+ out_noaction :
682
679
return ret ;
683
680
retry_nowait :
684
681
if (rpc_restart_call_prepare (task )) {
0 commit comments