From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmPqt-0001Fj-MS for qemu-devel@nongnu.org; Thu, 28 Jul 2011 08:38:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QmPqs-0000xY-QT for qemu-devel@nongnu.org; Thu, 28 Jul 2011 08:38:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmPqs-0000xM-I5 for qemu-devel@nongnu.org; Thu, 28 Jul 2011 08:38:10 -0400 Message-ID: <4E3158DE.2010404@redhat.com> Date: Thu, 28 Jul 2011 14:41:02 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1311791126-11383-1-git-send-email-freddy77@gmail.com> <1311791126-11383-2-git-send-email-freddy77@gmail.com> <20110727183122.GA14736@lst.de> <77083DC7-E37C-4B44-9A59-DB19E34D20E2@gmail.com> <20110727195718.GA16212@lst.de> <4E3113F9.9090902@redhat.com> <20110728121556.GA17125@lst.de> In-Reply-To: <20110728121556.GA17125@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] linux aio: support flush operation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Frediano Ziglio , "qemu-devel@nongnu.org" Am 28.07.2011 14:15, schrieb Christoph Hellwig: >> Christoph, on another note: Can we rely on Linux AIO never returning >> short writes except on EOF? Currently we return -EINVAL in this case, so "short reads" I meant, of course. >> I hope it's true or we wouldn't return the correct error code. > > More or less. There's one corner case for all Linux I/O, and that is > only writes up to INT_MAX are supported, and larger writes (and reads) > get truncated to it. It's pretty nasty, but Linux has been vocally > opposed to fixing this issue. I think we can safely ignore this. So just replacing the current ret = -EINVAL; by a memset(buf + ret, 0, len - ret); ret = 0; should be okay, right? (Of course using the qiov versions, but you get the idea) Kevin