Commit 16ad3db3 authored by Wang Qing's avatar Wang Qing Committed by Jens Axboe

nbd: fix order of cleaning up the queue and freeing the tagset

We must release the queue before freeing the tagset.

Fixes: 4af5f2e0 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-and-tested-by: syzbot+9ca43ff47167c0ee3466@syzkaller.appspotmail.com
Signed-off-by: default avatarWang Qing <wangqing@vivo.com>
Signed-off-by: default avatarGuoqing Jiang <jiangguoqing@kylinos.cn>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210706040016.1360412-1-guoqing.jiang@linux.devSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 58b63e0f
......@@ -239,8 +239,8 @@ static void nbd_dev_remove(struct nbd_device *nbd)
if (disk) {
del_gendisk(disk);
blk_mq_free_tag_set(&nbd->tag_set);
blk_cleanup_disk(disk);
blk_mq_free_tag_set(&nbd->tag_set);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment