From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jycha-0002Yc-RU for qemu-devel@nongnu.org; Tue, 20 May 2008 21:01:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JychZ-0002XX-Oi for qemu-devel@nongnu.org; Tue, 20 May 2008 21:01:10 -0400 Received: from [199.232.76.173] (port=48018 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JychZ-0002XM-GU for qemu-devel@nongnu.org; Tue, 20 May 2008 21:01:09 -0400 Received: from yw-out-1718.google.com ([74.125.46.154]:27924) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JychZ-0006d0-4g for qemu-devel@nongnu.org; Tue, 20 May 2008 21:01:09 -0400 Received: by yw-out-1718.google.com with SMTP id 6so1610045ywa.82 for ; Tue, 20 May 2008 18:00:59 -0700 (PDT) Message-ID: <48337444.2070203@codemonkey.ws> Date: Tue, 20 May 2008 20:00:52 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH][v2] Align file accesses with cache=off (O_DIRECT) References: <1211283126.4314.70.camel@frecb07144> <48332AB9.3010707@codemonkey.ws> <20080520223602.GE27853@shareable.org> In-Reply-To: <20080520223602.GE27853@shareable.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Laurent Vivier , Kevin Wolf Jamie Lokier wrote: > Anthony Liguori wrote: > >>> This patch implements wrappers for raw_pread and raw_pwrite which align >>> all file accesses and make qcow(2) work with cache=off. This method >>> might not be the most performant one (compared to fixing qcow, qcow2 and >>> everything else that might be using unaligned accesses), but unaligned >>> accesses don't happen that frequently and with this patch really all >>> image accesses should be covered." >>> > > It's a useful patch. > > One little esoteric consequence you might want to document. > > This occurs when a guest is running something like a database or > journalling filesystem, and is reliant on the host disk's integrity > properties. > > One property of disks is that if you overwrite a sector and the're > power loss, when read later that sector might be corrupt. Even if the > new data is the same as the old data with only some bytes changed, > some of the _unchanged_ bytes may be corrupt by this. > I don't think this is true. What evidence do you have to support such claims? Regards, Anthony Liguori > When it writes to sector-aligned offset, there is a possibility that > the guest is depending on power failure not causing corruption of > neighouring sectors. This is typical with some kinds of journalling. > > When sector-aligned guest offsets are converted to sector-unaligned > writes (e.g. due to qcow2 etc.), that property is no longer satisfied, > and power failure of the host disk can cause more damage than the > guest is designed to be resistant to. > > -- Jamie > > >