]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/block/nbd.c
nbd: handle interrupted sendmsg with a sndtimeo set
authorJosef Bacik <jbacik@fb.com>
Tue, 24 Oct 2017 19:57:18 +0000 (15:57 -0400)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 16 Nov 2017 13:23:25 +0000 (11:23 -0200)
commite158db48bd46ec11a2ae7ae7c2d29e462b6a715b
tree77765f2351e5f127803221b55a418c1fb7866a97
parentdef55c4b4a0aa5cf4efe02fe8aa4be7af217c87b
nbd: handle interrupted sendmsg with a sndtimeo set

BugLink: http://bugs.launchpad.net/bugs/1731961
commit 32e67a3a06b88904155170560b7a63d372b320bd upstream.

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.

Fixes: dc88e34d69d8 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/block/nbd.c