drbd: avoid spurious self-outdating with concurrent disconnect / down
authorLars Ellenberg <lars.ellenberg@linbit.com>
Thu, 20 Dec 2018 16:23:38 +0000 (17:23 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 20 Dec 2018 16:51:30 +0000 (09:51 -0700)
commitbe80ff88356ab6f5529daf24d3052a4e3cc727ec
tree41c6c04e785e2fe036aef58406b1114009ec875d
parentf708bd08ecbdc23d03aaedf5b3311ebe44cfdb50
drbd: avoid spurious self-outdating with concurrent disconnect / down

If peers are "simultaneously" told to disconnect from each other,
either explicitly, or implicitly by taking down the resource,
with bad timing, one side may see its disconnect "fail" with
a result of "state change failed by peer", and interpret this as
"please oudate yourself".

Try to catch this by checking for current connection status,
and possibly retry as local-only state change instead.

Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_nl.c