From: Wang Qing <wangqing@vivo.com>
To: Josef Bacik <josef@toxicpanda.com>, Jens Axboe <axboe@kernel.dk>,
Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
linux-block@vger.kernel.org, nbd@other.debian.org,
linux-kernel@vger.kernel.org
Cc: Wang Qing <wangqing@vivo.com>,
Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Subject: [PATCH] block: nbd: fix order of cleaning up the queue and freeing the tagset
Date: Mon, 5 Jul 2021 17:25:43 +0800 [thread overview]
Message-ID: <1625477143-18716-1-git-send-email-wangqing@vivo.com> (raw)
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
next reply other threads:[~2021-07-05 9:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-05 9:25 Wang Qing [this message]
2021-07-06 2:40 ` [PATCH] block: nbd: fix order of cleaning up the queue and freeing the tagset Guoqing Jiang
2021-07-06 2:48 ` 王擎
2021-07-06 4:00 ` [PATCH V2] " Guoqing Jiang
2021-07-06 4:17 ` Christoph Hellwig
2021-07-15 6:55 ` Christoph Hellwig
2021-07-15 15:29 ` [PATCH] block: " Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1625477143-18716-1-git-send-email-wangqing@vivo.com \
--to=wangqing@vivo.com \
--cc=axboe@kernel.dk \
--cc=chaitanya.kulkarni@wdc.com \
--cc=guoqing.jiang@cloud.ionos.com \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@other.debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.