]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commite966998d0aaa2a0126e1e725b780ef43b1986dc2
treef139323df2a6f193fe0063532299baedb32af1df
parentcaa0eeeafc54e23c3f46f329a83fa8b967b8c611
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