Displaying 4 results from an estimated 4 matches for "e5b8f338".
2020 Mar 27
4
[nbdkit PATCH 0/2] Improve shutdown race in nbd plugin
I still need more soak time on testing, to see whether I can:
a) reproduce the hang with patch 2 not applied
b) feel confident that patch 2 is sufficient to fix the race, or else
determine that I also need to augment the loop condition in the reader
thread to additionally break out of the loop when the pipe-to-self
sees EOF even when nbd_aio_is_dead() has not yet been satisfied
I'm also
2020 Mar 27
0
[nbdkit PATCH 1/2] nbd: Don't reference stale errno in reader loop
...be latent as long as the pipe is non-blocking and the
write end is not closed.
Fixes: e0d32468
Signed-off-by: Eric Blake <eblake@redhat.com>
---
plugins/nbd/nbd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c
index d020beec..e5b8f338 100644
--- a/plugins/nbd/nbd.c
+++ b/plugins/nbd/nbd.c
@@ -332,9 +332,11 @@ nbdplug_reader (void *handle)
/* Check if we were kicked because a command was started */
if (fds[1].revents & POLLIN) {
- while (read (h->fds[0], &c, 1) == 1)
+ int r;
+
+ while ((r = r...
2020 Mar 27
0
[nbdkit PATCH 2/2] nbd: Reorder cleanup to avoid getting stuck in poll()
....
Fixes: ab7760fc
Signed-off-by: Eric Blake <eblake@redhat.com>
---
May be incomplete: I might also need to break out of the reader loop
when read() returns 0.
plugins/nbd/nbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c
index e5b8f338..23a7da06 100644
--- a/plugins/nbd/nbd.c
+++ b/plugins/nbd/nbd.c
@@ -537,10 +537,10 @@ nbdplug_close_handle (struct handle *h)
{
if (nbd_shutdown (h->nbd, 0) == -1)
nbdkit_debug ("failed to clean up handle: %s", nbd_get_error ());
+ close (h->fds[1]);
if ((errno = pthre...
2020 Mar 27
1
Re: [nbdkit PATCH 2/2] nbd: Reorder cleanup to avoid getting stuck in poll()
...blake@redhat.com>
> ---
>
> May be incomplete: I might also need to break out of the reader loop
> when read() returns 0.
>
> plugins/nbd/nbd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c
> index e5b8f338..23a7da06 100644
> --- a/plugins/nbd/nbd.c
> +++ b/plugins/nbd/nbd.c
> @@ -537,10 +537,10 @@ nbdplug_close_handle (struct handle *h)
> {
> if (nbd_shutdown (h->nbd, 0) == -1)
> nbdkit_debug ("failed to clean up handle: %s", nbd_get_error ());
> + close (h...