[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH][v2] Align file accesses with cache=off (O_D

From: Jamie Lokier
Subject: Re: [Qemu-devel] Re: [PATCH][v2] Align file accesses with cache=off (O_DIRECT)
Date: Tue, 20 May 2008 23:36:02 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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

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.

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]