]> 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)
commitb0c85b07a9f113ea1d342745665bb12e17088a58
treef139323df2a6f193fe0063532299baedb32af1df
parenta7637a5ffef90bbf9486ae67e491560a00ab165a
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