Skip to content

Commit

Permalink
nbd: allow multiple disconnects to be sent
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Josef Bacik authored and Jens Axboe committed Jul 22, 2017
1 parent 82abbea commit 2e13456
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2e13456

Please sign in to comment.