From: Samer Al-Kiswany <samera@ece.ubc.ca>
To: "'Chris Mason'" <clm@fb.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: RE: mkdir and fsync
Date: Sun, 14 Sep 2014 13:56:38 -0700 [thread overview]
Message-ID: <BAY168-DS278FBACE27850B5FD3BDEEC1CB0@phx.gbl> (raw)
In-Reply-To: <5411A3AC.1050705@fb.com>
Thank you Chris,
We use kernel 3.2 in a virtual machine using VirtualBox. We will test it
with the latest kernel version and let you know if we face the same issue.
Thank you
-samer
http://www.ece.ubc.ca/~samera/
http://www.cs.wisc.edu/~samera/
-----Original Message-----
From: Chris Mason [mailto:clm@fb.com]
Sent: Thursday, September 11, 2014 6:29 AM
To: Samer Al-Kiswany; linux-btrfs@vger.kernel.org
Subject: Re: mkdir and fsync
On 09/10/2014 04:55 PM, Samer Al-Kiswany wrote:
> Hi,
>
> Thank you for help.
>
> I am seeing a strange behavior when fsync()ing a directory.
>
> Here is what I do
>
> for (i=0; i < 100,000, i++){
> .
> mkdir(p/child_i)
> fsync(p)
> }
>
> 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?
Which kernel and hardware? We had some dir fsync handling bugs in the past
which may have been related.
I just did a test here, and we're definitely doing the IO. Christoph is
right about the requirements for fsync being sloppy. For btrfs, we do put
directory changes into the log during an fsync, but we may end up logging
only what you fsync.
So this will get child_i:
mkdir(p/child_i)
fsync(p)
This will not:
mkdir(p/child_i)
fsync(some_other_directory_that_isn't_p)
(This is different from ext34)
-chris
prev parent reply other threads:[~2014-09-14 21:05 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
2014-09-11 13:29 ` Chris Mason
2014-09-14 20:56 ` Samer Al-Kiswany [this message]
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=BAY168-DS278FBACE27850B5FD3BDEEC1CB0@phx.gbl \
--to=samera@ece.ubc.ca \
--cc=clm@fb.com \
--cc=linux-btrfs@vger.kernel.org \
/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).