On Wed, Sep 10, 2014 at 01:55:35PM -0700, Samer Al-Kiswany wrote:
> Btrfs seems to achieve around 100k fsycs/second, which makes me believe it
> is not touching the disk during these fsyncs.
> After looking at the code, it seems indeed that fsync adds the inode to the
> current transaction but does not sync the transaction to disk.
>
> Is this the intended behavior for metadata fsync or is this a bug?
> Is this POSIX compliant?
Posix is basically meaningless for fsync:
The fsync() function shall request that all data for the open file
descriptor named by fildes is to be transferred to the storage
device associated with the file described by fildes. The nature of
the transfer is implementation-defined. The fsync() function shall
not return until the system has completed that action or until an
error is detected.
[SIO] [Option Start] If _POSIX_SYNCHRONIZED_IO is defined, the
fsync() function shall force all currently queued I/O operations
associated with the file indicated by file descriptor fildes to
the synchronized I/O completion state. All I/O operations shall
be completed as defined for synchronized I/O file integrity
completion. [Option End]
but Linux semantics do expect a filesystem to write out all metadata for
a directory file descriptor on a fsync.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html