On Tue, May 11, 2010 at 11:11:12PM +0100, Paul Brook wrote: > .. though it may be a kernel bug rather that a qemu bug, depending on the > exact details. Either way, I consider any mode that inhibits host filesystem > write cache but not volatile drive cache to be pretty worthless. Either we > guaranteed data integrity on completion or we don't.
O_DIRECT just means bypassing the pagecache, it does not mean flushing the disk cache on every access, which for certain workloads can be very painful. It also doesn't require a synchronous writeout of metadata required to reach the data, e.g. in case when we have to allocate blocks for a sparse image file. To get the behaviour you want you need O_DIRECT|O_DSYNC, which is something that is not exposed by qemu's current cache= suboption. If we want to implement this properly we need to split the cache option, as I already mentioned. This would also have benefits in other areas, but again refer to my previous mail for that.