block: call blk_queue_free_zone_bitmaps from disk_release

The zone bitmaps are only used for non-passthrough I/O, so free them as
soon as the disk is released.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20220706070350.1703384-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig 2022-07-06 09:03:36 +02:00 committed by Jens Axboe
parent f1a8bbd110
commit 6cc37a672a
2 changed files with 1 additions and 2 deletions

View File

@ -776,8 +776,6 @@ static void blk_release_queue(struct kobject *kobj)
blk_free_queue_stats(q->stats);
kfree(q->poll_stat);
blk_queue_free_zone_bitmaps(q);
if (queue_is_mq(q))
blk_mq_release(q);

View File

@ -1165,6 +1165,7 @@ static void disk_release(struct device *dev)
disk_release_events(disk);
kfree(disk->random);
blk_queue_free_zone_bitmaps(disk->queue);
xa_destroy(&disk->part_tbl);
disk->queue->disk = NULL;