diff options
author | Ming Lei <ming.lei@redhat.com> | 2021-12-21 12:04:36 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-12-20 21:07:51 -0700 |
commit | 37e11c3616f6182b6bd7f95a04df035b43464f39 (patch) | |
tree | 1c967b8b2be29949e82c5105055fc7827cb370b2 /block | |
parent | a957b61254a7d59a6c14ee2ac2db20a62eb299a1 (diff) | |
download | linux-rpi-37e11c3616f6182b6bd7f95a04df035b43464f39.tar.gz linux-rpi-37e11c3616f6182b6bd7f95a04df035b43464f39.tar.bz2 linux-rpi-37e11c3616f6182b6bd7f95a04df035b43464f39.zip |
block: call blk_exit_queue() before freeing q->stats
blk_stat_disable_accounting() is added in commit 68497092bde9
("block: make queue stat accounting a reference"), and called in
kyber_exit_sched().
So we have to free q->stats after elevator is unloaded from
blk_exit_queue() in blk_release_queue(). Otherwise kernel panic
is caused.
Fixes: 68497092bde9 ("block: make queue stat accounting a reference")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20211221040436.1333880-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 3e6357321225..e20eadfcf5c8 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -791,11 +791,11 @@ static void blk_release_queue(struct kobject *kobj) blk_stat_remove_callback(q, q->poll_cb); blk_stat_free_callback(q->poll_cb); + blk_exit_queue(q); + blk_free_queue_stats(q->stats); kfree(q->poll_stat); - blk_exit_queue(q); - blk_queue_free_zone_bitmaps(q); if (queue_is_mq(q)) |