summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJosef Bacik2018-05-16 20:51:20 +0200
committerJens Axboe2018-05-16 20:54:10 +0200
commit96d97e17828f97b321bd364c818819121f855650 (patch)
treef8259f492b7a5bbf24fa3e8c4138a09a8803f8d3 /drivers/block
parentnbd: use bd_set_size when updating disk size (diff)
downloadkernel-qcow2-linux-96d97e17828f97b321bd364c818819121f855650.tar.gz
kernel-qcow2-linux-96d97e17828f97b321bd364c818819121f855650.tar.xz
kernel-qcow2-linux-96d97e17828f97b321bd364c818819121f855650.zip
nbd: clear_sock on netlink disconnect
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> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nbd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 64278f472efe..06725ce97593 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1768,6 +1768,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))