File tree 3 files changed +6
-0
lines changed
3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -3922,6 +3922,7 @@ int iscsi_target_tx_thread(void *arg)
3922
3922
* connection recovery / failure event can be triggered externally.
3923
3923
*/
3924
3924
allow_signal (SIGINT );
3925
+ complete (& conn -> kthr_start_comp );
3925
3926
3926
3927
while (!kthread_should_stop ()) {
3927
3928
/*
@@ -4170,6 +4171,7 @@ int iscsi_target_rx_thread(void *arg)
4170
4171
* connection recovery / failure event can be triggered externally.
4171
4172
*/
4172
4173
allow_signal (SIGINT );
4174
+ complete (& conn -> kthr_start_comp );
4173
4175
/*
4174
4176
* Wait for iscsi_post_login_handler() to complete before allowing
4175
4177
* incoming iscsi/tcp socket I/O, and/or failing the connection.
Original file line number Diff line number Diff line change @@ -660,6 +660,7 @@ int iscsit_start_kthreads(struct iscsit_conn *conn)
660
660
ret = PTR_ERR (conn -> tx_thread );
661
661
goto out_bitmap ;
662
662
}
663
+ wait_for_completion (& conn -> kthr_start_comp );
663
664
conn -> tx_thread_active = true;
664
665
665
666
conn -> rx_thread = kthread_run (iscsi_target_rx_thread , conn ,
@@ -669,6 +670,7 @@ int iscsit_start_kthreads(struct iscsit_conn *conn)
669
670
ret = PTR_ERR (conn -> rx_thread );
670
671
goto out_tx ;
671
672
}
673
+ wait_for_completion (& conn -> kthr_start_comp );
672
674
conn -> rx_thread_active = true;
673
675
674
676
return 0 ;
@@ -1064,6 +1066,7 @@ static struct iscsit_conn *iscsit_alloc_conn(struct iscsi_np *np)
1064
1066
init_completion (& conn -> rx_half_close_comp );
1065
1067
init_completion (& conn -> tx_half_close_comp );
1066
1068
init_completion (& conn -> rx_login_comp );
1069
+ init_completion (& conn -> kthr_start_comp );
1067
1070
spin_lock_init (& conn -> cmd_lock );
1068
1071
spin_lock_init (& conn -> conn_usage_lock );
1069
1072
spin_lock_init (& conn -> immed_queue_lock );
Original file line number Diff line number Diff line change @@ -550,6 +550,7 @@ struct iscsit_conn {
550
550
struct completion conn_logout_comp ;
551
551
struct completion tx_half_close_comp ;
552
552
struct completion rx_half_close_comp ;
553
+ struct completion kthr_start_comp ;
553
554
/* socket used by this connection */
554
555
struct socket * sock ;
555
556
void (* orig_data_ready )(struct sock * );
You can’t perform that action at this time.
0 commit comments