drbd: do not block when adjusting "disk-options" while IO is frozen
authorLars Ellenberg <lars.ellenberg@linbit.com>
Thu, 20 Dec 2018 16:23:37 +0000 (17:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:34:49 +0000 (15:34 +0100)
commit26b3a730a56d598077ced857f1ef1d4271a9f37e
treefc768fb8b906e1c1464d8138e87aaf99d723f8a1
parent6bd1d015756b7271bb49c101f2759cf98e9525b1
drbd: do not block when adjusting "disk-options" while IO is frozen

[ Upstream commit f708bd08ecbdc23d03aaedf5b3311ebe44cfdb50 ]

"suspending" IO is overloaded.
It can mean "do not allow new requests" (obviously),
but it also may mean "must not complete pending IO",
for example while the fencing handlers do their arbitration.

When adjusting disk options, we suspend io (disallow new requests), then
wait for the activity-log to become unused (drain all IO completions),
and possibly replace it with a new activity log of different size.

If the other "suspend IO" aspect is active, pending IO completions won't
happen, and we would block forever (unkillable drbdsetup process).

Fix this by skipping the activity log adjustment if the "al-extents"
setting did not change. Also, in case it did change, fail early without
blocking if it looks like we would block forever.

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