From: Christoph Hellwig <hch@infradead.org>
To: Samer Al-Kiswany <samera@ece.ubc.ca>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: mkdir and fsync
Date: Wed, 10 Sep 2014 18:29:15 -0700 [thread overview]
Message-ID: <20140911012915.GA17887@infradead.org> (raw)
In-Reply-To: <BAY168-DS1747B8D83FA04E0D49D89AC1CF0@phx.gbl>
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.
next prev parent reply other threads:[~2014-09-11 1:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-10 20:55 mkdir and fsync Samer Al-Kiswany
2014-09-11 1:29 ` Christoph Hellwig [this message]
2014-09-11 13:29 ` Chris Mason
2014-09-14 20:56 ` Samer Al-Kiswany
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140911012915.GA17887@infradead.org \
--to=hch@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=samera@ece.ubc.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).