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 @@ -3813,6 +3813,7 @@ int iscsi_target_tx_thread(void *arg)
3813
3813
* connection recovery / failure event can be triggered externally.
3814
3814
*/
3815
3815
allow_signal (SIGINT );
3816
+ complete (& conn -> kthr_start_comp );
3816
3817
3817
3818
while (!kthread_should_stop ()) {
3818
3819
/*
@@ -4041,6 +4042,7 @@ int iscsi_target_rx_thread(void *arg)
4041
4042
* connection recovery / failure event can be triggered externally.
4042
4043
*/
4043
4044
allow_signal (SIGINT );
4045
+ complete (& conn -> kthr_start_comp );
4044
4046
/*
4045
4047
* Wait for iscsi_post_login_handler() to complete before allowing
4046
4048
* incoming iscsi/tcp socket I/O, and/or failing the connection.
Original file line number Diff line number Diff line change @@ -646,6 +646,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
646
646
ret = PTR_ERR (conn -> tx_thread );
647
647
goto out_bitmap ;
648
648
}
649
+ wait_for_completion (& conn -> kthr_start_comp );
649
650
conn -> tx_thread_active = true;
650
651
651
652
conn -> rx_thread = kthread_run (iscsi_target_rx_thread , conn ,
@@ -655,6 +656,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
655
656
ret = PTR_ERR (conn -> rx_thread );
656
657
goto out_tx ;
657
658
}
659
+ wait_for_completion (& conn -> kthr_start_comp );
658
660
conn -> rx_thread_active = true;
659
661
660
662
return 0 ;
@@ -1127,6 +1129,7 @@ static struct iscsi_conn *iscsit_alloc_conn(struct iscsi_np *np)
1127
1129
init_completion (& conn -> rx_half_close_comp );
1128
1130
init_completion (& conn -> tx_half_close_comp );
1129
1131
init_completion (& conn -> rx_login_comp );
1132
+ init_completion (& conn -> kthr_start_comp );
1130
1133
spin_lock_init (& conn -> cmd_lock );
1131
1134
spin_lock_init (& conn -> conn_usage_lock );
1132
1135
spin_lock_init (& conn -> immed_queue_lock );
Original file line number Diff line number Diff line change @@ -562,6 +562,7 @@ struct iscsi_conn {
562
562
struct completion conn_logout_comp ;
563
563
struct completion tx_half_close_comp ;
564
564
struct completion rx_half_close_comp ;
565
+ struct completion kthr_start_comp ;
565
566
/* socket used by this connection */
566
567
struct socket * sock ;
567
568
void (* orig_data_ready )(struct sock * );
You can’t perform that action at this time.
0 commit comments