From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHr5C-0003li-T1 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 07:21:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHr57-0002Jz-Qj for qemu-devel@nongnu.org; Tue, 28 Jun 2016 07:21:33 -0400 References: <1466681836-1123-1-git-send-email-den@openvz.org> From: "Denis V. Lunev" Message-ID: <57725DB0.50503@openvz.org> Date: Tue, 28 Jun 2016 14:21:20 +0300 MIME-Version: 1.0 In-Reply-To: <1466681836-1123-1-git-send-email-den@openvz.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] block: fix return code for partial write for Linux AIO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: Pavel Borzenkov , Kevin Wolf , Max Reitz On 06/23/2016 02:37 PM, Denis V. Lunev wrote: > 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 > --- > block/linux-aio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/linux-aio.c b/block/linux-aio.c > index e468960..7df8651 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; > } > } > } ping