qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.6 1/2] block/gluster: return correct error


From: Niels de Vos
Subject: Re: [Qemu-devel] [PATCH for-2.6 1/2] block/gluster: return correct error value
Date: Wed, 6 Apr 2016 17:00:49 +0200
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Apr 05, 2016 at 11:29:51PM -0400, Jeff Cody wrote:
> Upon error, gluster will call the aio callback function with a
> ret value of -1, with errno set to the proper error value.  If
> we set the acb->ret value to the return value in the callback,
> that results in every error being EPERM (i.e. 1).  Instead, set
> it to the proper error result.
> 
> Signed-off-by: Jeff Cody <address@hidden>

Looks good to me.

Reviewed-by: Niels de Vos <address@hidden>

> ---
>  block/gluster.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/gluster.c b/block/gluster.c
> index 7bface2..30a827e 100644
> --- a/block/gluster.c
> +++ b/block/gluster.c
> @@ -245,7 +245,7 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, 
> ssize_t ret, void *arg)
>      if (!ret || ret == acb->size) {
>          acb->ret = 0; /* Success */
>      } else if (ret < 0) {
> -        acb->ret = ret; /* Read/Write failed */
> +        acb->ret = -errno; /* Read/Write failed */
>      } else {
>          acb->ret = -EIO; /* Partial read/write - fail it */
>      }
> -- 
> 1.9.3
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]