Re: [PATCH, RFC] virtio_blk: add cache flush command

Christoph Hellwig
2009-05-18T12:06:32Z

On Tue, May 12, 2009 at 11:35:23AM +0300, Avi Kivity wrote:
> >The cache size on disks is constantly growing, and if you lose cache
> >it doesn't really matter how much you lose but what you lose.
> >
>
> Software errors won't cause data loss on a real disk (firmware bugs
> will, but the firmware is less likely to crash than the host OS).

OS crash or hardware crash really makes no difference for writeback
caches. The case we are trying to protect against here is any crash,
and a hardware induced one or power failure is probably more likely
in either case than a software failure in either the OS or firmware.

> >If you care about data integrity in case of crashes qcow2 doesn't work
> >at all.
> >
>
> Do you known of any known corruptors in qcow2 with cache=writethrough?

It's not related to cache=writethrough. The issue is that there are no
transactional guarantees in qcow2.