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 3/5] nbd: clear_sock on netlink disconnect
Date: Wed, 16 May 2018 14:36:03 -0400 [thread overview]
Message-ID: <20180516183605.16159-3-josef@toxicpanda.com> (raw)
In-Reply-To: <20180516183605.16159-1-josef@toxicpanda.com>
From: Josef Bacik <jbacik@fb.com>
This is what the ioctl based nbd disconnect does as well. Without this
the device will just sit there and wait for the connection to go away
(or IO to occur) before the device gets torn down. Instead clear
everything up on our end so the configuration goes away as quickly as
possible.
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
drivers/block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 7e83d6364b35..bc47bae9697a 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1765,6 +1765,7 @@ static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info)
}
mutex_lock(&nbd->config_lock);
nbd_disconnect(nbd);
+ nbd_clear_sock(nbd);
mutex_unlock(&nbd->config_lock);
if (test_and_clear_bit(NBD_HAS_CONFIG_REF,
&nbd->config->runtime_flags))
--
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 ` [PATCH 2/5] nbd: do queue cleanup after del_gendisk Josef Bacik
2018-05-16 18:36 ` Josef Bacik [this message]
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-3-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