All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] gluster: Abort on AIO completion failure
@ 2013-08-27  5:53 Bharata B Rao
  2013-08-27  6:58 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Bharata B Rao @ 2013-08-27  5:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, asias, stefanha, Bharata B Rao

Currently if gluster AIO callback thread fails to notify the QEMU thread about
AIO completion, we try graceful recovery by marking the disk drive as
inaccessible. This error recovery code is race-prone as found by Asias and
Stefan. However as found out by Paolo, this kind of error is impossible and
hence simplify the code that handles this error recovery.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
 block/gluster.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/block/gluster.c b/block/gluster.c
index 46f36f8..942154a 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -427,20 +427,9 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg)
         /*
          * Gluster AIO callback thread failed to notify the waiting
          * QEMU thread about IO completion.
-         *
-         * Complete this IO request and make the disk inaccessible for
-         * subsequent reads and writes.
          */
-        error_report("Gluster failed to notify QEMU about IO completion");
-
-        qemu_mutex_lock_iothread(); /* We are in gluster thread context */
-        acb->common.cb(acb->common.opaque, -EIO);
-        qemu_aio_release(acb);
-        close(s->fds[GLUSTER_FD_READ]);
-        close(s->fds[GLUSTER_FD_WRITE]);
-        qemu_aio_set_fd_handler(s->fds[GLUSTER_FD_READ], NULL, NULL, NULL);
-        bs->drv = NULL; /* Make the disk inaccessible */
-        qemu_mutex_unlock_iothread();
+        error_report("Gluster AIO completion failed");
+        abort();
     }
 }
 
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] gluster: Abort on AIO completion failure
  2013-08-27  5:53 [Qemu-devel] [PATCH] gluster: Abort on AIO completion failure Bharata B Rao
@ 2013-08-27  6:58 ` Paolo Bonzini
  2013-08-27  8:16   ` Bharata B Rao
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2013-08-27  6:58 UTC (permalink / raw)
  To: Bharata B Rao; +Cc: kwolf, asias, qemu-devel, stefanha

Il 27/08/2013 07:53, Bharata B Rao ha scritto:
> Currently if gluster AIO callback thread fails to notify the QEMU thread about
> AIO completion, we try graceful recovery by marking the disk drive as
> inaccessible. This error recovery code is race-prone as found by Asias and
> Stefan. However as found out by Paolo, this kind of error is impossible and
> hence simplify the code that handles this error recovery.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> ---
>  block/gluster.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/block/gluster.c b/block/gluster.c
> index 46f36f8..942154a 100644
> --- a/block/gluster.c
> +++ b/block/gluster.c
> @@ -427,20 +427,9 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg)
>          /*
>           * Gluster AIO callback thread failed to notify the waiting
>           * QEMU thread about IO completion.
> -         *
> -         * Complete this IO request and make the disk inaccessible for
> -         * subsequent reads and writes.
>           */
> -        error_report("Gluster failed to notify QEMU about IO completion");
> -
> -        qemu_mutex_lock_iothread(); /* We are in gluster thread context */
> -        acb->common.cb(acb->common.opaque, -EIO);
> -        qemu_aio_release(acb);
> -        close(s->fds[GLUSTER_FD_READ]);
> -        close(s->fds[GLUSTER_FD_WRITE]);
> -        qemu_aio_set_fd_handler(s->fds[GLUSTER_FD_READ], NULL, NULL, NULL);
> -        bs->drv = NULL; /* Make the disk inaccessible */
> -        qemu_mutex_unlock_iothread();
> +        error_report("Gluster AIO completion failed");

Still, considering everyone can be wrong, adding the errno here is
probably not a bad idea. :)

Paolo

> +        abort();
>      }
>  }
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] gluster: Abort on AIO completion failure
  2013-08-27  6:58 ` Paolo Bonzini
@ 2013-08-27  8:16   ` Bharata B Rao
  0 siblings, 0 replies; 3+ messages in thread
From: Bharata B Rao @ 2013-08-27  8:16 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kwolf, asias, qemu-devel, stefanha

On Tue, Aug 27, 2013 at 08:58:05AM +0200, Paolo Bonzini wrote:
> > diff --git a/block/gluster.c b/block/gluster.c
> > index 46f36f8..942154a 100644
> > --- a/block/gluster.c
> > +++ b/block/gluster.c
> > @@ -427,20 +427,9 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg)
> >          /*
> >           * Gluster AIO callback thread failed to notify the waiting
> >           * QEMU thread about IO completion.
> > -         *
> > -         * Complete this IO request and make the disk inaccessible for
> > -         * subsequent reads and writes.
> >           */
> > -        error_report("Gluster failed to notify QEMU about IO completion");
> > -
> > -        qemu_mutex_lock_iothread(); /* We are in gluster thread context */
> > -        acb->common.cb(acb->common.opaque, -EIO);
> > -        qemu_aio_release(acb);
> > -        close(s->fds[GLUSTER_FD_READ]);
> > -        close(s->fds[GLUSTER_FD_WRITE]);
> > -        qemu_aio_set_fd_handler(s->fds[GLUSTER_FD_READ], NULL, NULL, NULL);
> > -        bs->drv = NULL; /* Make the disk inaccessible */
> > -        qemu_mutex_unlock_iothread();
> > +        error_report("Gluster AIO completion failed");
> 
> Still, considering everyone can be wrong, adding the errno here is
> probably not a bad idea. :)

Sent v1 with errno added.

Regards,
Bharata.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-27  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-27  5:53 [Qemu-devel] [PATCH] gluster: Abort on AIO completion failure Bharata B Rao
2013-08-27  6:58 ` Paolo Bonzini
2013-08-27  8:16   ` Bharata B Rao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.