From: Josef Bacik <josef@toxicpanda.com>
To: axboe@kernel.dk, nbd@other.debian.org,
linux-block@vger.kernel.org, kernel-team@fb.com
Cc: Josef Bacik <jbacik@fb.com>
Subject: [PATCH 2/5] nbd: do queue cleanup after del_gendisk
Date: Wed, 16 May 2018 14:36:02 -0400 [thread overview]
Message-ID: <20180516183605.16159-2-josef@toxicpanda.com> (raw)
In-Reply-To: <20180516183605.16159-1-josef@toxicpanda.com>
From: Josef Bacik <jbacik@fb.com>
Apparently del_gendisk is actually supposed to happen first to cleanup
the sysfs stuff.
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
drivers/block/nbd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 7b7b6143a126..7e83d6364b35 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -173,9 +173,12 @@ static const struct device_attribute pid_attr = {
static void nbd_dev_remove(struct nbd_device *nbd)
{
struct gendisk *disk = nbd->disk;
+ struct request_queue *q;
+
if (disk) {
- blk_cleanup_queue(disk->queue);
+ q = disk->queue;
del_gendisk(disk);
+ blk_cleanup_queue(q);
blk_mq_free_tag_set(&nbd->tag_set);
disk->private_data = NULL;
put_disk(disk);
--
2.14.3
next prev parent reply other threads:[~2018-05-16 18:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 18:36 [PATCH 1/5] block: fix MAINTAINERS email for nbd Josef Bacik
2018-05-16 18:36 ` Josef Bacik [this message]
2018-05-16 18:36 ` [PATCH 3/5] nbd: clear_sock on netlink disconnect Josef Bacik
2018-05-16 18:36 ` [PATCH 4/5] nbd: fix how we set bd_invalidated Josef Bacik
2018-05-16 18:36 ` [PATCH 5/5] nbd: call nbd_bdev_reset instead of bd_set_size on disconnect Josef Bacik
2018-05-16 18:50 ` [PATCH 1/5] block: fix MAINTAINERS email for nbd Josef Bacik
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=20180516183605.16159-2-josef@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=axboe@kernel.dk \
--cc=jbacik@fb.com \
--cc=kernel-team@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox