aboutsummaryrefslogtreecommitdiff
path: root/block/linux-aio.c
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 /block/linux-aio.c
parent5411541270f1d9e8eb1fb442fa4908c4398d5d88 (diff)
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>
Diffstat (limited to 'block/linux-aio.c')
-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 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;
}
}
}