[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync
From: |
Christoph Hellwig |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync |
Date: |
Mon, 31 Aug 2009 23:55:25 +0200 |
User-agent: |
Mutt/1.3.28i |
On Mon, Aug 31, 2009 at 10:51:38PM +0100, Jamie Lokier wrote:
> Christoph Hellwig wrote:
> >
> > If we are flushing the caches for our image files we only care about the
> > data (including the metadata required for accessing it) but not things
> > like timestamp updates. So use fdatasync instead of fsync to implement
> > the flush operations.
>
> > - fsync(s->fd);
> > + fdatasync(s->fd);
>
> I believe fsync was used because of uncertainty about whether
> fdatasync reliably flushes the necessary metadata to access the data
> on all hosts, after things like writing to holes and extending a file.
>
> I'm still not sure if fdatasync provides that guarantee on Linux.
fdatasync is defined to provide that guarantee, and modulo the whole
clusterfuck around volatile write caches it does the right thing
thing on common Linux filesystems.
- Re: [Qemu-devel] [PATCH 1/4] block: add enable_write_cache flag, (continued)
- Re: [Qemu-devel] [PATCH 1/4] block: add enable_write_cache flag, Anthony Liguori, 2009/08/31
- Re: [Qemu-devel] [PATCH 1/4] block: add enable_write_cache flag, Jamie Lokier, 2009/08/31
- Re: [Qemu-devel] [PATCH 1/4] block: add enable_write_cache flag, Christoph Hellwig, 2009/08/31
- Re: [Qemu-devel] [PATCH 1/4] block: add enable_write_cache flag, Jamie Lokier, 2009/08/31
- Re: [Qemu-devel] [PATCH 1/4] block: add enable_write_cache flag, Christoph Hellwig, 2009/08/31
- Re: [Qemu-devel] [PATCH 1/4] block: add enable_write_cache flag, Christoph Hellwig, 2009/08/31
[Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync, Christoph Hellwig, 2009/08/31
[Qemu-devel] [PATCH 3/4] block: add bdrv_aio_flush operation, Christoph Hellwig, 2009/08/31
[Qemu-devel] [PATCH 4/4] virtio-blk: add volatile writecache feature, Christoph Hellwig, 2009/08/31