nbd: don't start req until after the dead connection logic
authorJosef Bacik <jbacik@fb.com>
Mon, 6 Nov 2017 21:11:58 +0000 (16:11 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:40:41 +0000 (08:40 +0000)
commit2031e243efeea84f4f121018715e8c7755ee1914
tree2145b2d34aade402cd5f53ae73e16989d63a0646
parentf6b7c54c2d0ee8fe4d3b1cdfdb1961a80be60d3f
nbd: don't start req until after the dead connection logic

commit 6a468d5990ecd1c2d07dd85f8633bbdd0ba61c40 upstream.

We can end up sleeping for a while waiting for the dead timeout, which
means we could get the per request timer to fire.  We did handle this
case, but if the dead timeout happened right after we submitted we'd
either tear down the connection or possibly requeue as we're handling an
error and race with the endio which can lead to panics and other
hilarity.

Fixes: 560bc4b39952 ("nbd: handle dead connections")
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/nbd.c