]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: clear disconnected on reconnect
authorJosef Bacik <jbacik@fb.com>
Tue, 25 Jul 2017 17:31:19 +0000 (13:31 -0400)
committerJens Axboe <axboe@kernel.dk>
Tue, 25 Jul 2017 19:58:34 +0000 (13:58 -0600)
commita5f35ef4d95afd91774bb5ce602852bed23d1965
tree5e781d1f34127a19e16f72be4b901a9c1582e8e5
parent21b4bf7d8ce5082b640671c3a077e9591c493898
nbd: clear disconnected on reconnect

If our device loses its connection for longer than the dead timeout we
will set NBD_DISCONNECTED in order to quickly fail any pending IO's that
flood in after the IO's that were waiting during the dead timer.
However if we re-connect at some point in the future we'll still see
this DISCONNECTED flag set if we then lose our connection again after
that, which means we won't get notifications for our newly lost
connections.  Fix this by just clearing the DISCONNECTED flag on
reconnect in order to make sure everything works as it's supposed to.

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