summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2016-04-05 23:11:34 -0400
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 20:03:49 -0600
commite502c33b9049fb3bd30250e8bd57f50a2f9a4eec (patch)
treefc78ce142762f7ae0361966c52eab2ecf3686307
parente1633e3ddc5767182ebcfc04eecf496acbf4f75e (diff)
downloadhqemu-e502c33b9049fb3bd30250e8bd57f50a2f9a4eec.zip
hqemu-e502c33b9049fb3bd30250e8bd57f50a2f9a4eec.tar.gz
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 <ndevos@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com>
-rw-r--r--block/gluster.c2
1 files changed, 1 insertions, 1 deletions
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 */
}
OpenPOWER on IntegriCloud