From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56221 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Prqgs-0002i4-MY for qemu-devel@nongnu.org; Tue, 22 Feb 2011 06:46:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Prqgr-0005AH-JB for qemu-devel@nongnu.org; Tue, 22 Feb 2011 06:46:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Prqgr-00059x-6v for qemu-devel@nongnu.org; Tue, 22 Feb 2011 06:46:01 -0500 Message-ID: <4D63A1E8.4000101@redhat.com> Date: Tue, 22 Feb 2011 12:45:44 +0100 From: Jes Sorensen 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> <4D63A19E.8000806@redhat.com> In-Reply-To: <4D63A19E.8000806@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: Kevin Wolf Cc: hch@infradead.org, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com On 02/22/11 12:44, Kevin Wolf wrote: >> @@ -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 I guess we could retry the last part of the request, but if we already have an error, it seems silly to try to rewrite the same stuff again just to obtain the error code. I looked through the aio calls and I didn't find any obvious way to retrieve the error code, but maybe I missed something? Cheers, Jes