OSDN Git Service

blk-mq: fix allocation for queue mapping table
authorMing Lei <ming.lei@redhat.com>
Mon, 17 Dec 2018 10:42:45 +0000 (18:42 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 17 Dec 2018 12:37:23 +0000 (05:37 -0700)
Type of each element in queue mapping table is 'unsigned int,
intead of 'struct blk_mq_queue_map)', so fix it.

Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c

index 2d3a29e..313f28b 100644 (file)
@@ -3019,7 +3019,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
        ret = -ENOMEM;
        for (i = 0; i < set->nr_maps; i++) {
                set->map[i].mq_map = kcalloc_node(nr_cpu_ids,
-                                                 sizeof(struct blk_mq_queue_map),
+                                                 sizeof(set->map[i].mq_map[0]),
                                                  GFP_KERNEL, set->numa_node);
                if (!set->map[i].mq_map)
                        goto out_free_mq_map;