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 @@ -3815,6 +3815,7 @@ int iscsi_target_tx_thread(void *arg)
38153815 * connection recovery / failure event can be triggered externally.
38163816 */
38173817 allow_signal (SIGINT );
3818+ complete (& conn -> kthr_start_comp );
38183819
38193820 while (!kthread_should_stop ()) {
38203821 /*
@@ -4043,6 +4044,7 @@ int iscsi_target_rx_thread(void *arg)
40434044 * connection recovery / failure event can be triggered externally.
40444045 */
40454046 allow_signal (SIGINT );
4047+ complete (& conn -> kthr_start_comp );
40464048 /*
40474049 * Wait for iscsi_post_login_handler() to complete before allowing
40484050 * 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)
647647 ret = PTR_ERR (conn -> tx_thread );
648648 goto out_bitmap ;
649649 }
650+ wait_for_completion (& conn -> kthr_start_comp );
650651 conn -> tx_thread_active = true;
651652
652653 conn -> rx_thread = kthread_run (iscsi_target_rx_thread , conn ,
@@ -656,6 +657,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
656657 ret = PTR_ERR (conn -> rx_thread );
657658 goto out_tx ;
658659 }
660+ wait_for_completion (& conn -> kthr_start_comp );
659661 conn -> rx_thread_active = true;
660662
661663 return 0 ;
@@ -1104,6 +1106,7 @@ static struct iscsi_conn *iscsit_alloc_conn(struct iscsi_np *np)
11041106 init_completion (& conn -> rx_half_close_comp );
11051107 init_completion (& conn -> tx_half_close_comp );
11061108 init_completion (& conn -> rx_login_comp );
1109+ init_completion (& conn -> kthr_start_comp );
11071110 spin_lock_init (& conn -> cmd_lock );
11081111 spin_lock_init (& conn -> conn_usage_lock );
11091112 spin_lock_init (& conn -> immed_queue_lock );
Original file line number Diff line number Diff line change @@ -552,6 +552,7 @@ struct iscsi_conn {
552552 struct completion conn_logout_comp ;
553553 struct completion tx_half_close_comp ;
554554 struct completion rx_half_close_comp ;
555+ struct completion kthr_start_comp ;
555556 /* socket used by this connection */
556557 struct socket * sock ;
557558 void (* orig_data_ready )(struct sock * );
You can’t perform that action at this time.
0 commit comments