]> git.baikalelectronics.ru Git - kernel.git/commit
block: disable the elevator int del_gendisk
authorChristoph Hellwig <hch@lst.de>
Tue, 14 Jun 2022 07:48:24 +0000 (09:48 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 17 Jun 2022 13:31:05 +0000 (07:31 -0600)
commit71662cdc8a5917a7f2bffafd6c7b78bef724fc22
treec71b4e1bf63b621b1dba9a1e5b740b31f41d0552
parenta8bb83681a67cc11ced19f8a31a17234ddd125a7
block: disable the elevator int del_gendisk

The elevator is only used for file system requests, which are stopped in
del_gendisk.  Move disabling the elevator and freeing the scheduler tags
to the end of del_gendisk instead of doing that work in disk_release and
blk_cleanup_queue to avoid a use after free on q->tag_set from
disk_release as the tag_set might not be alive at that point.

Move the blk_qos_exit call as well, as it just depends on the elevator
exit and would be the only reason to keep the not exactly cheap queue
freeze in disk_release.

Fixes: 8537c9eeb586 ("blk-mq: Use shared tags for shared sbitmap support")
Reported-by: syzbot+3e3f419f4a7816471838@syzkaller.appspotmail.com
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: syzbot+3e3f419f4a7816471838@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20220614074827.458955-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/genhd.c