Skip to contentSkip to conversation

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

PATCH Applied Wang Qing 5 participants 7 messages Jul 5, 2021 – Jul 15, 2021

Subsystems (2)
lore
Share & tools
lore

Wang Qing

author
#0 lore raw

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

Must release the queue before freeing the tagset.

Fixes 1c99502fae35 ("loop: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-and-tested-by [email protected]
---
 drivers/block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/nbd.c +1 -1
index b7d6637..c383179
@@ -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);
 	}
 
 	/*
Signature · 1 line
2.7.4
author
#2 lore raw
Quoted 9 lines · Wang Qing
Quoted 4 lines

Must release the queue before freeing the tagset.

Fixes 1c99502fae35 ("loop: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-and-tested-by [email protected]

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.

Quoted 5 lines
Quoted 3 lines

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

Quoted 2 lines

Guoqing

#3 lore raw

PATCH v2 1/1 nbd: fix order of cleaning up the queue and freeing the tagset

In reply to Wang Qing

From: Wang Qing <[email protected]>

We must release the queue before freeing the tagset.

Fixes 4af5f2e03013 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-and-tested-by [email protected]

---
V2 changes: Correct the fixes tag and mail address.

 drivers/block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/nbd.c +1 -1
index b7d663736d35..c38317979f74 100644
@@ -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);
 	}
 
 	/*
Signature · 1 line
2.25.1
Reviewed-by on v2 1/1
#4 lore raw

Re: [PATCH V2] nbd: fix order of cleaning up the queue and freeing the tagset

Quoted 8 lines · Guoqing Jiang

From: Wang Qing <[email protected]>

We must release the queue before freeing the tagset.

Fixes 4af5f2e03013 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-and-tested-by [email protected]

Looks good,

#5 lore raw

Re: [PATCH V2] nbd: fix order of cleaning up the queue and freeing the tagset

In reply to Guoqing Jiang

Jens, can you pick this up?

Quoted 31 lines · Guoqing Jiang

From: Wang Qing <[email protected]>

We must release the queue before freeing the tagset.

Fixes 4af5f2e03013 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-and-tested-by [email protected]

---
V2 changes: Correct the fixes tag and mail address.

 drivers/block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/nbd.c +1 -1
index b7d663736d35..c38317979f74 100644
@@ -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);
 	}
 
 	/*
Signature · 1 line
2.25.1

---end quoted text---

maintainer Applied
#6 lore raw
In reply to Wang Qing
Quoted 1 line · Wang Qing

Must release the queue before freeing the tagset.

Applied, thanks.

Signature · 1 line
Jens Axboe