@@ -3824,16 +3824,11 @@ static int blk_mq_init_hctx(struct request_queue *q,
3824
3824
{
3825
3825
hctx -> queue_num = hctx_idx ;
3826
3826
3827
- if (!(hctx -> flags & BLK_MQ_F_STACKING ))
3828
- cpuhp_state_add_instance_nocalls (CPUHP_AP_BLK_MQ_ONLINE ,
3829
- & hctx -> cpuhp_online );
3830
- cpuhp_state_add_instance_nocalls (CPUHP_BLK_MQ_DEAD , & hctx -> cpuhp_dead );
3831
-
3832
3827
hctx -> tags = set -> tags [hctx_idx ];
3833
3828
3834
3829
if (set -> ops -> init_hctx &&
3835
3830
set -> ops -> init_hctx (hctx , set -> driver_data , hctx_idx ))
3836
- goto unregister_cpu_notifier ;
3831
+ goto fail ;
3837
3832
3838
3833
if (blk_mq_init_request (set , hctx -> fq -> flush_rq , hctx_idx ,
3839
3834
hctx -> numa_node ))
@@ -3842,6 +3837,11 @@ static int blk_mq_init_hctx(struct request_queue *q,
3842
3837
if (xa_insert (& q -> hctx_table , hctx_idx , hctx , GFP_KERNEL ))
3843
3838
goto exit_flush_rq ;
3844
3839
3840
+ if (!(hctx -> flags & BLK_MQ_F_STACKING ))
3841
+ cpuhp_state_add_instance_nocalls (CPUHP_AP_BLK_MQ_ONLINE ,
3842
+ & hctx -> cpuhp_online );
3843
+ cpuhp_state_add_instance_nocalls (CPUHP_BLK_MQ_DEAD , & hctx -> cpuhp_dead );
3844
+
3845
3845
return 0 ;
3846
3846
3847
3847
exit_flush_rq :
@@ -3850,8 +3850,7 @@ static int blk_mq_init_hctx(struct request_queue *q,
3850
3850
exit_hctx :
3851
3851
if (set -> ops -> exit_hctx )
3852
3852
set -> ops -> exit_hctx (hctx , hctx_idx );
3853
- unregister_cpu_notifier :
3854
- blk_mq_remove_cpuhp (hctx );
3853
+ fail :
3855
3854
return -1 ;
3856
3855
}
3857
3856
0 commit comments