]> 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)
commit4da334cd378fd1c9d1d56e695ba54109a2697465
treeb51b63e136dec5ffeb42af6c68fe866b719fbd6d
parent64e944dcee99976996f6afced0e0783376202b1c
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: e966998d0aaa ("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