]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg/simple/Pipe: avoid returning 0 on poll timeout 12376/head
authorSage Weil <sage@redhat.com>
Thu, 8 Dec 2016 00:25:55 +0000 (18:25 -0600)
committerSage Weil <sage@redhat.com>
Thu, 8 Dec 2016 00:27:35 +0000 (18:27 -0600)
commitf7abffec751e454d119df273dc6e49e5f7106078
tree22338b5ffcb5c0d8baf67ef5e57c568f97e49c89
parent9411351cc8ce9ee03fbd46225102fe3d28ddf611
msg/simple/Pipe: avoid returning 0 on poll timeout

If poll times out it will return 0 (no data to read on socket).  In
165e5abdbf6311974d4001e43982b83d06f9e0cc we changed tcp_read_wait from
returning -1 to returning -errno, which means we return 0 instead of -1
in this case.

This makes tcp_read() get into an infinite loop by repeatedly trying to
read from the socket and getting EAGAIN.

Fix by explicitly checking for a 0 return from poll(2) and returning
EAGAIN in that case.

Fixes: http://tracker.ceph.com/issues/18184
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 6c3d015c6854a12cda40673848813d968ff6afae)
src/msg/simple/Pipe.cc