ublk: reorder tag_set initialization before queue allocation

commit 011af85ccd upstream.

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>
[ Upstream commit 529d4d6327 ("ublk: implement NUMA-aware memory allocation")
  is ported to linux-6.18.y, but it depends on commit 011af85ccd ("ublk:
  reorder tag_set initialization before queue allocation"). kernel panic is
  reported on 6.18.y: https://github.com/ublk-org/ublksrv/issues/174 ]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ming Lei 2025-11-01 21:31:16 +08:00 • committed by Greg Kroah-Hartman
commit a1d420370a