Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ublk: reorder tag_set initialization before queue allocation

Move ublk_add_tag_set() before ublk_init_queues() in the device
initialization path. This allows us to use the blk-mq CPU-to-queue
mapping established by the tag_set to determine the appropriate
NUMA node for each queue allocation.

The error handling paths are also reordered accordingly.

Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
011af85c bc49af56

+6 -6
+6 -6
drivers/block/ublk_drv.c
··· 3178 3178 ub->dev_info.nr_hw_queues, nr_cpu_ids); 3179 3179 ublk_align_max_io_size(ub); 3180 3180 3181 - ret = ublk_init_queues(ub); 3181 + ret = ublk_add_tag_set(ub); 3182 3182 if (ret) 3183 3183 goto out_free_dev_number; 3184 3184 3185 - ret = ublk_add_tag_set(ub); 3185 + ret = ublk_init_queues(ub); 3186 3186 if (ret) 3187 - goto out_deinit_queues; 3187 + goto out_free_tag_set; 3188 3188 3189 3189 ret = -EFAULT; 3190 3190 if (copy_to_user(argp, &ub->dev_info, sizeof(info))) 3191 - goto out_free_tag_set; 3191 + goto out_deinit_queues; 3192 3192 3193 3193 /* 3194 3194 * Add the char dev so that ublksrv daemon can be setup. ··· 3197 3197 ret = ublk_add_chdev(ub); 3198 3198 goto out_unlock; 3199 3199 3200 - out_free_tag_set: 3201 - blk_mq_free_tag_set(&ub->tag_set); 3202 3200 out_deinit_queues: 3203 3201 ublk_deinit_queues(ub); 3202 + out_free_tag_set: 3203 + blk_mq_free_tag_set(&ub->tag_set); 3204 3204 out_free_dev_number: 3205 3205 ublk_free_dev_number(ub); 3206 3206 out_free_ub: