nbd: don't requeue the same request twice.
authorJosef Bacik <josef@toxicpanda.com>
Mon, 16 Jul 2018 16:11:34 +0000 (12:11 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:26:25 +0000 (09:26 +0200)
commitced413c5ef85cf2da775043a9480a86139eb6de7
tree9c31f1ab4286d774aca6b68842362a5324b2582e
parent962ff36dac014618c60acae78db9a872abde7480
nbd: don't requeue the same request twice.

[ Upstream commit d7d94d48a272fd7583dc3c83acb8f5ed4ef456a4 ]

We can race with the snd timeout and the per-request timeout and end up
requeuing the same request twice.  We can't use the send_complete
completion to tell if everything is ok because we hold the tx_lock
during send, so the timeout stuff will block waiting to mark the socket
dead, and we could be marked complete and still requeue.  Instead add a
flag to the socket so we know whether we've been requeued yet.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/nbd.c