File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -3870,6 +3870,7 @@ int iscsi_target_tx_thread(void *arg)
3870
3870
* connection recovery / failure event can be triggered externally.
3871
3871
*/
3872
3872
allow_signal (SIGINT );
3873
+ complete (& conn -> kthr_start_comp );
3873
3874
3874
3875
while (!kthread_should_stop ()) {
3875
3876
/*
@@ -4116,6 +4117,7 @@ int iscsi_target_rx_thread(void *arg)
4116
4117
* connection recovery / failure event can be triggered externally.
4117
4118
*/
4118
4119
allow_signal (SIGINT );
4120
+ complete (& conn -> kthr_start_comp );
4119
4121
/*
4120
4122
* Wait for iscsi_post_login_handler() to complete before allowing
4121
4123
* incoming iscsi/tcp socket I/O, and/or failing the connection.
Original file line number Diff line number Diff line change @@ -619,6 +619,7 @@ int iscsit_start_kthreads(struct iscsit_conn *conn)
619
619
ret = PTR_ERR (conn -> tx_thread );
620
620
goto out_bitmap ;
621
621
}
622
+ wait_for_completion (& conn -> kthr_start_comp );
622
623
conn -> tx_thread_active = true;
623
624
624
625
conn -> rx_thread = kthread_run (iscsi_target_rx_thread , conn ,
@@ -628,6 +629,7 @@ int iscsit_start_kthreads(struct iscsit_conn *conn)
628
629
ret = PTR_ERR (conn -> rx_thread );
629
630
goto out_tx ;
630
631
}
632
+ wait_for_completion (& conn -> kthr_start_comp );
631
633
conn -> rx_thread_active = true;
632
634
633
635
return 0 ;
@@ -1023,6 +1025,7 @@ static struct iscsit_conn *iscsit_alloc_conn(struct iscsi_np *np)
1023
1025
init_completion (& conn -> rx_half_close_comp );
1024
1026
init_completion (& conn -> tx_half_close_comp );
1025
1027
init_completion (& conn -> rx_login_comp );
1028
+ init_completion (& conn -> kthr_start_comp );
1026
1029
spin_lock_init (& conn -> cmd_lock );
1027
1030
spin_lock_init (& conn -> conn_usage_lock );
1028
1031
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