From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55221 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Prqdm-00013t-V3 for qemu-devel@nongnu.org; Tue, 22 Feb 2011 06:42:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Prqdl-0004bI-PO for qemu-devel@nongnu.org; Tue, 22 Feb 2011 06:42:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Prqdl-0004am-Fz for qemu-devel@nongnu.org; Tue, 22 Feb 2011 06:42:49 -0500 Message-ID: <4D63A19E.8000806@redhat.com> Date: Tue, 22 Feb 2011 12:44:30 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1298369880-23859-1-git-send-email-Jes.Sorensen@redhat.com> <1298369880-23859-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1298369880-23859-2-git-send-email-Jes.Sorensen@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] For AIO return -ENOSPC on short write List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes.Sorensen@redhat.com Cc: hch@infradead.org, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Am 22.02.2011 11:18, schrieb Jes.Sorensen@redhat.com: > From: Jes Sorensen > > Signed-off-by: Jes Sorensen > --- > 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