]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: handle unexpected replies better
authorJosef Bacik <josef@toxicpanda.com>
Mon, 16 Jul 2018 16:11:35 +0000 (12:11 -0400)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Jul 2018 16:14:40 +0000 (10:14 -0600)
commit2b7273d6199d05eda0a3b4f396412fdc80b1c058
tree0679226e653f76f3d82be9dd11b558f42f842504
parent590a7fbcbb5bcfdf4b6e1f2ff9178f79b2c15233
nbd: handle unexpected replies better

If the server or network is misbehaving and we get an unexpected reply
we can sometimes miss the request not being started and wait on a
request and never get a response, or even double complete the same
request.  Fix this by replacing the send_complete completion with just a
per command lock.  Add a per command cookie as well so that we can know
if we're getting a double completion for a previous event.  Also check
to make sure we dont have REQUEUED set as that means we raced with the
timeout handler and need to just let the retry occur.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c