]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
nbd: allow multiple disconnects to be sent
authorJosef Bacik <jbacik@fb.com>
Fri, 21 Jul 2017 14:48:13 +0000 (10:48 -0400)
committerJens Axboe <axboe@kernel.dk>
Sat, 22 Jul 2017 17:12:29 +0000 (11:12 -0600)
There's no reason to limit ourselves to one disconnect message per
socket.  Sometimes networks do strange things, might as well let
sysadmins hit the panic button as much as they want.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c

index 87a0a29f6e7e3c5a5f84332cc72de4543e6a86dd..f91e7ac3fa320dc40bd2adc3e37bc2e572931efa 100644 (file)
@@ -991,9 +991,8 @@ static int nbd_disconnect(struct nbd_device *nbd)
        struct nbd_config *config = nbd->config;
 
        dev_info(disk_to_dev(nbd->disk), "NBD_DISCONNECT\n");
-       if (!test_and_set_bit(NBD_DISCONNECT_REQUESTED,
-                             &config->runtime_flags))
-               send_disconnects(nbd);
+       set_bit(NBD_DISCONNECT_REQUESTED, &config->runtime_flags);
+       send_disconnects(nbd);
        return 0;
 }