nbd: set sk->sk_sndtimeo for our sockets
authorJosef Bacik <jbacik@fb.com>
Thu, 8 Jun 2017 19:39:30 +0000 (15:39 -0400)
committerJens Axboe <axboe@fb.com>
Fri, 9 Jun 2017 14:33:19 +0000 (08:33 -0600)
commitdc88e34d69d87c370deaa9d613dac8e3a0411f59
treef139323df2a6f193fe0063532299baedb32af1df
parentb040ad9cf6a169cc000a5324fcada695dfa1f4b3
nbd: set sk->sk_sndtimeo for our sockets

If the nbd server stops receiving packets altogether we will get stuck
waiting for them to receive indefinitely as the tcp buffer will never
empty, which looks like a deadlock.  Fix this by setting the sk send
timeout to our configured timeout, that way if the server really
misbehaves we'll disconnect cleanly instead of waiting forever.

Reported-by: Dan Melnic <dmm@fb.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nbd.c