Displaying 3 results from an estimated 3 matches for "d356afe".
Did you mean:
d156ace
2019 Jun 27
3
[libnbd PATCH 0/2] socket handling cleanups
While working on a new test of what happens when the server goes away
while commands are in flight, I managed to hit a race where I hit
death from SIGPIPE instead of a clean transition to the DEAD state. I
also found myself wanting to use nbd_poll from the test, but with a
way to distinguish between the state machine progressing vs. hanging.
Eric Blake (2):
socket: Avoid SIGPIPE where possible
2019 Jun 27
1
Re: [libnbd PATCH 2/2] poll: Improve our interface
...nbd_handle *h, int timeout)
> set_error (errno, "poll");
> return -1;
> }
I also need to squash in this, to fix our use of an uninitialized
variable when nbd_aio_get_direction returns 0 (such as when we are
already DEAD):
diff --git i/lib/poll.c w/lib/poll.c
index d356afe..fc6aae5 100644
--- i/lib/poll.c
+++ w/lib/poll.c
@@ -45,6 +45,8 @@ nbd_unlocked_poll (struct nbd_handle *h, int timeout)
case LIBNBD_AIO_DIRECTION_BOTH:
fds[0].events = POLLIN|POLLOUT;
break;
+ default:
+ fds[0].events = 0;
}
fds[0].revents = 0;
--
Eric Blake, Principal So...
2019 Jun 27
0
[libnbd PATCH 2/2] poll: Improve our interface
...;nbd_aio_notify_read>.
+or C<POLLHUP> you would then call C<nbd_aio_notify_read>.
Note that once libnbd reaches C<nbd_aio_is_ready>, this direction is
returned even before a command is issued via C<nbd_aio_pwrite> and
diff --git a/lib/poll.c b/lib/poll.c
index 982b172..d356afe 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -57,21 +57,28 @@ nbd_unlocked_poll (struct nbd_handle *h, int timeout)
set_error (errno, "poll");
return -1;
}
+ if (r == 0)
+ return 0;
/* POLLIN and POLLOUT might both be set. However we shouldn't call
* both nbd_...