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 @@ -3815,6 +3815,7 @@ int iscsi_target_tx_thread(void *arg)
3815
3815
* connection recovery / failure event can be triggered externally.
3816
3816
*/
3817
3817
allow_signal (SIGINT );
3818
+ complete (& conn -> kthr_start_comp );
3818
3819
3819
3820
while (!kthread_should_stop ()) {
3820
3821
/*
@@ -4043,6 +4044,7 @@ int iscsi_target_rx_thread(void *arg)
4043
4044
* connection recovery / failure event can be triggered externally.
4044
4045
*/
4045
4046
allow_signal (SIGINT );
4047
+ complete (& conn -> kthr_start_comp );
4046
4048
/*
4047
4049
* Wait for iscsi_post_login_handler() to complete before allowing
4048
4050
* incoming iscsi/tcp socket I/O, and/or failing the connection.
Original file line number Diff line number Diff line change @@ -647,6 +647,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
647
647
ret = PTR_ERR (conn -> tx_thread );
648
648
goto out_bitmap ;
649
649
}
650
+ wait_for_completion (& conn -> kthr_start_comp );
650
651
conn -> tx_thread_active = true;
651
652
652
653
conn -> rx_thread = kthread_run (iscsi_target_rx_thread , conn ,
@@ -656,6 +657,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
656
657
ret = PTR_ERR (conn -> rx_thread );
657
658
goto out_tx ;
658
659
}
660
+ wait_for_completion (& conn -> kthr_start_comp );
659
661
conn -> rx_thread_active = true;
660
662
661
663
return 0 ;
@@ -1104,6 +1106,7 @@ static struct iscsi_conn *iscsit_alloc_conn(struct iscsi_np *np)
1104
1106
init_completion (& conn -> rx_half_close_comp );
1105
1107
init_completion (& conn -> tx_half_close_comp );
1106
1108
init_completion (& conn -> rx_login_comp );
1109
+ init_completion (& conn -> kthr_start_comp );
1107
1110
spin_lock_init (& conn -> cmd_lock );
1108
1111
spin_lock_init (& conn -> conn_usage_lock );
1109
1112
spin_lock_init (& conn -> immed_queue_lock );
Original file line number Diff line number Diff line change @@ -552,6 +552,7 @@ struct iscsi_conn {
552
552
struct completion conn_logout_comp ;
553
553
struct completion tx_half_close_comp ;
554
554
struct completion rx_half_close_comp ;
555
+ struct completion kthr_start_comp ;
555
556
/* socket used by this connection */
556
557
struct socket * sock ;
557
558
void (* orig_data_ready )(struct sock * );
You can’t perform that action at this time.
0 commit comments