[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: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync
Date: Mon, 31 Aug 2009 22:51:38 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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.

-- Jamie

reply via email to

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