diff mbox series

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

Message ID 1625477143-18716-1-git-send-email-wangqing@vivo.com (mailing list archive)
State New, archived
Headers show
Series block: nbd: fix order of cleaning up the queue and freeing the tagset | expand

Commit Message

王擎 July 5, 2021, 9:25 a.m. UTC
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(-)

Comments

Guoqing Jiang July 6, 2021, 2:40 a.m. UTC | #1
On 7/5/21 5:25 PM, Wang Qing wrote:
> 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

Did syzbot actually test the change?

> Signed-off-by: Wang Qing <wangqing@vivo.com>
> Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>

I don't mind you sent it quickly, but pls remove my outdated mail account.

Guoqing
王擎 July 6, 2021, 2:48 a.m. UTC | #2
>
>On 7/5/21 5:25 PM, Wang Qing wrote:
>> 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
>
>Did syzbot actually test the change?

Yes, I have initiated the test, and did not report this error again, but still reported other known errors,
so I think the test passed. And this is an obvious problem, it needs to be fixed anyway.

>
>> Signed-off-by: Wang Qing <wangqing@vivo.com>
>> Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
>
>I don't mind you sent it quickly, but pls remove my outdated mail account.

Sorry about this, you can re-initiate a patch if you don't mind, 
as if you still have one thing to modify.

Qing
>
>Guoqing
Jens Axboe July 15, 2021, 3:29 p.m. UTC | #3
On 7/5/21 3:25 AM, Wang Qing wrote:
> Must release the queue before freeing the tagset.

Applied, thanks.
diff mbox series

Patch

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);
 	}
 
 	/*