]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: handle interrupted sendmsg with a sndtimeo set
authorJosef Bacik <jbacik@fb.com>
Tue, 24 Oct 2017 19:57:18 +0000 (15:57 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 25 Oct 2017 00:50:59 +0000 (18:50 -0600)
commit5cc2e58af716c7e716c19ab894e38d0cecaa1ccf
treeb51b63e136dec5ffeb42af6c68fe866b719fbd6d
parent0802f84df2d46c2c149bc3c854491ab5949ab45d
nbd: handle interrupted sendmsg with a sndtimeo set

If you do not set sk_sndtimeo you will get -ERESTARTSYS if there is a
pending signal when you enter sendmsg, which we handle properly.
However if you set a timeout for your commands we'll set sk_sndtimeo to
that timeout, which means that sendmsg will start returning -EINTR
instead of -ERESTARTSYS.  Fix this by checking either cases and doing
the correct thing.

Cc: stable@vger.kernel.org
Fixes: b0c85b07a9f1 ("nbd: set sk->sk_sndtimeo for our sockets")
Reported-and-tested-by: Daniel Xu <dlxu@fb.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c