From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42784 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1e8y-0003B6-2A for qemu-devel@nongnu.org; Mon, 21 Mar 2011 08:23:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1e8v-00070S-Cl for qemu-devel@nongnu.org; Mon, 21 Mar 2011 08:23:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1e8v-0006zt-0c for qemu-devel@nongnu.org; Mon, 21 Mar 2011 08:23:29 -0400 Message-ID: <4D874337.3040105@redhat.com> Date: Mon, 21 Mar 2011 14:23:19 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] block: Flush image after open References: <1299687353-20424-1-git-send-email-kwolf@redhat.com> <20110309172757.GA2884@lst.de> <4D77BB1B.9030704@codemonkey.ws> In-Reply-To: <4D77BB1B.9030704@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , Christoph Hellwig , qemu-devel@nongnu.org On 03/09/2011 07:38 PM, Anthony Liguori wrote: > On 03/09/2011 11:27 AM, Christoph Hellwig wrote: >> On Wed, Mar 09, 2011 at 05:15:53PM +0100, Kevin Wolf wrote: >>> Quoting the bug report: >>> >>> qemu ensures that guest writes and qemu metadata writes hit the >>> disk >>> when necessary to prevent data corruption. However, if an image >>> was >>> in host pagecache prior to starting qemu, for example after >>> running >>> qemu-img convert, then nothing prevents writes from reaching the >>> disk out of order, potentially causing corruption. >>> >>> I'm not entirely sure if there is a realistic case where we would get >>> corruption, but it's probably a case of better safe than sorry. >> Except for SCSI with ordered tags (which we don't support) there are not >> ordering guarantees in the storage protocols, and as such the above >> explanation >> doesn't make any sense at all. > > Even if there was, a guest shouldn't be relying on the ordering of a > write that comes from a non-guest. > > I don't understand the failure scenario here. $ cp x.img y.img $ qemu -drive file=y.img,cache=writeback The guest may expect that any or none of its writes hit the disk, but that anything that it read from the disk, stays there. -- error compiling committee.c: too many arguments to function