[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] For AIO return -ENOSPC on short write
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] Re: [PATCH] For AIO return -ENOSPC on short write |
Date: |
Tue, 22 Feb 2011 12:44:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10 |
Am 22.02.2011 11:18, schrieb address@hidden:
> From: Jes Sorensen <address@hidden>
>
> Signed-off-by: Jes Sorensen <address@hidden>
> ---
> linux-aio.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/linux-aio.c b/linux-aio.c
> index 68f4b3d..d9c0225 100644
> --- a/linux-aio.c
> +++ b/linux-aio.c
> @@ -32,6 +32,7 @@ struct qemu_laiocb {
> ssize_t ret;
> size_t nbytes;
> int async_context_id;
> + int type;
> QLIST_ENTRY(qemu_laiocb) node;
> };
>
> @@ -62,6 +63,9 @@ static void qemu_laio_process_completion(struct
> qemu_laio_state *s,
> if (ret != -ECANCELED) {
> if (ret == laiocb->nbytes)
> ret = 0;
> + else if ((laiocb->type == QEMU_AIO_WRITE) && (ret >= 0) &&
> + (ret < laiocb->nbytes))
> + ret = -ENOSPC;
> else if (ret >= 0)
> ret = -EINVAL;
Isn't there a way to get the real error code instead of just making it
up more cleverly? Like retrying for the rest of the request?
Kevin