All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: josef@toxicpanda.com, axboe@kernel.dk, hch@lst.de,
	chaitanya.kulkarni@wdc.com
Cc: linux-block@vger.kernel.org, nbd@other.debian.org
Subject: [PATCH V2] nbd: fix order of cleaning up the queue and freeing the tagset
Date: Tue,  6 Jul 2021 12:00:16 +0800	[thread overview]
Message-ID: <20210706040016.1360412-1-guoqing.jiang@linux.dev> (raw)
In-Reply-To: <1625477143-18716-1-git-send-email-wangqing@vivo.com>

From: Wang Qing <wangqing@vivo.com>

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: syzbot+9ca43ff47167c0ee3466@syzkaller.appspotmail.com
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Guoqing Jiang <jiangguoqing@kylinos.cn>
---
V2 changes: Correct the fixes tag and mail address.

 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 b7d663736d35..c38317979f74 100644
--- 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.25.1


  parent reply	other threads:[~2021-07-06  4:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-06  4:00 ` Guoqing Jiang [this message]
2021-07-06  4:17   ` [PATCH V2] " 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=20210706040016.1360412-1-guoqing.jiang@linux.dev \
    --to=guoqing.jiang@linux.dev \
    --cc=axboe@kernel.dk \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@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.