From 1c42f149ddc1ff7dd897ef2696ad662955a5ab2b Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Thu, 23 Jun 2016 14:37:16 +0300 Subject: 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 CC: Pavel Borzenkov CC: Kevin Wolf CC: Max Reitz Signed-off-by: Kevin Wolf --- block/linux-aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/linux-aio.c') diff --git a/block/linux-aio.c b/block/linux-aio.c index e468960146..7df8651581 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; } } } -- cgit v1.2.1