From: Jeff Cody Date: Wed, 6 Apr 2016 03:11:34 +0000 (-0400) Subject: block/gluster: return correct error value X-Git-Tag: TizenStudio_2.0_p2.4~27^2~6^2~8^2~26^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a882745356b17925b83c93d0b821adba8050236f;p=sdk%2Femulator%2Fqemu.git block/gluster: return correct error value 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. Reviewed-by: Niels de Vos Signed-off-by: Jeff Cody --- diff --git a/block/gluster.c b/block/gluster.c index 51e154c..b0e2cc2 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -247,7 +247,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 */ }