linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: nbd: fix order of cleaning up the queue and freeing the tagset
@ 2021-07-05  9:25 Wang Qing
  2021-07-06  2:40 ` Guoqing Jiang
  2021-07-15 15:29 ` Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Wang Qing @ 2021-07-05  9:25 UTC (permalink / raw)
  To: Josef Bacik, Jens Axboe, Chaitanya Kulkarni, linux-block, nbd,
	linux-kernel
  Cc: Wang Qing, Guoqing Jiang

Must release the queue before freeing the tagset.

Fixes: 1c99502fae35 ("loop: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-and-tested-by: syzbot+9ca43ff47167c0ee3466@syzkaller.appspotmail.com
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
---
 drivers/block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index b7d6637..c383179
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -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);
 	}
 
 	/*
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-15 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05  9:25 [PATCH] block: nbd: fix order of cleaning up the queue and freeing the tagset Wang Qing
2021-07-06  2:40 ` Guoqing Jiang
2021-07-06  2:48   ` 王擎
2021-07-15 15:29 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).