Skip to content
Snippets Groups Projects
Commit a8827453 authored by Jeff Cody's avatar Jeff Cody
Browse files

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: default avatarNiels de Vos <ndevos@redhat.com>
Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
parent d4dffa4a
No related branches found
No related tags found
No related merge requests found
......@@ -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 */
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment