public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Zhu Han <schumi.han@gmail.com>
Cc: xfs@oss.sgi.com
Subject: Re: Directory fsync
Date: Fri, 23 Sep 2011 12:33:54 -0400	[thread overview]
Message-ID: <20110923163354.GA24319@infradead.org> (raw)
In-Reply-To: <CAF7KpS8h2KDsLVzwAj=5ig-yuuiCwjQSVk0Nfy9UJ0qiyAqeCQ@mail.gmail.com>

On Fri, Sep 23, 2011 at 11:12:02PM +0800, Zhu Han wrote:
> I note below words in the manual of fsync:
>        Calling  fsync()  does  not  necessarily  ensure  that  the entry in
> the directory containing the file has also reached disk.  For that an
> explicit fsync() on a file
>        descriptor for the directory is also needed.
> 
> I am wondering is directory sync is essential after below steps if I want to
> assure the file can be retrieved after system crash?
> 
> 1) create file A
> 2) write file A
> 3) fsync(file A)
> 
> --------------------------------> fsync(parent directory) [Is it essential
> to make the inode linked to parent directory?]

As far as standards are concerned it is.  As far as the current XFS
implementation is concerned you don't need it as the file fsync will
also force out all transactions that belong to the create.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-09-23 16:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23 15:12 Directory fsync Zhu Han
2011-09-23 16:33 ` Christoph Hellwig [this message]
2011-09-23 23:09   ` Michael Monnerie
2011-09-24  1:20     ` Zhu Han
2011-10-01 23:20       ` Peter Grandi
2011-09-26  0:28     ` Dave Chinner
2011-09-26  0:51       ` Christoph Hellwig

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=20110923163354.GA24319@infradead.org \
    --to=hch@infradead.org \
    --cc=schumi.han@gmail.com \
    --cc=xfs@oss.sgi.com \
    /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