Subject: Re: letting userland issue FUA writes
To: Daniel Carosone <email@example.com>
From: =?ISO-8859-15?Q?Joachim_K=F6nig-Baltes?= <firstname.lastname@example.org>
Date: 03/16/2006 09:23:50
Daniel Carosone wrote:
> Just for general background, can we please clarify/confirm some of the
> semantics involved?
> - FUA applies only to the specific write carrying that flag, and
> says nothing about whether other unordered writes that may be
> sitting in the disk's write-cache have to hit the platters? ie, it
> is distinct from implying a cache flush around the write, and
> distinct from ordered vs unordered writes. it's up to the host and
> filesystem and/or application to worry about structural
> dependencies and transactional boundaries using these tools.
> - O_*SYNC applies to all IO done with the file descriptor, and
> basically does imply an fsync() or at least fdatasync(), even for
> data written by other processes with the same file open.
In addition to fsync(fd) and fdatasync(fd) we also have:
fsync_range(int fd, int how, off_t start, off_t length)
This would still be two calls, write + fsync_range and a bit of
bookkeeping for the current position, but at least the semantics
can be expressed without race conditions.