aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2016-06-23 14:37:16 +0300
committerKevin Wolf <kwolf@redhat.com>2016-07-05 16:46:26 +0200
commit1c42f149ddc1ff7dd897ef2696ad662955a5ab2b (patch)
tree06a89427b5b60bd4a24c24d518b9ecb598c40be0
parent5411541270f1d9e8eb1fb442fa4908c4398d5d88 (diff)
downloadqemu-1c42f149ddc1ff7dd897ef2696ad662955a5ab2b.zip
qemu-1c42f149ddc1ff7dd897ef2696ad662955a5ab2b.tar.gz
qemu-1c42f149ddc1ff7dd897ef2696ad662955a5ab2b.tar.bz2
block: fix return code for partial write for Linux AIO
Partial write most likely means that there is not space rather than "something wrong happens". Thus it would be more natural to return ENOSPC rather than EINVAL. The problem actually happens with NBD server, which has reported EINVAL rather then ENOSPC on the first error using its protocol, which makes report to the user wrong. Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Pavel Borzenkov <pborzenkov@virtuozzo.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/linux-aio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/linux-aio.c b/block/linux-aio.c
index e468960..7df8651 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -87,7 +87,7 @@ static void qemu_laio_process_completion(struct qemu_laiocb *laiocb)
qemu_iovec_memset(laiocb->qiov, ret, 0,
laiocb->qiov->size - ret);
} else {
- ret = -EINVAL;
+ ret = -ENOSPC;
}
}
}