All of lore.kernel.org
 help / color / mirror / Atom feed
From: tytso@mit.edu
To: Peng Tao <bergwolf@gmail.com>
Cc: bugzilla-daemon@bugzilla.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [Bug 15910] zero-length files and performance degradation
Date: Mon, 10 May 2010 10:34:33 -0400	[thread overview]
Message-ID: <20100510143433.GS18762@thunk.org> (raw)
In-Reply-To: <AANLkTilQyGvZeyJiGZFjkKIF9qXPQ2l1YNh_W8jvg1J0@mail.gmail.com>

On Mon, May 10, 2010 at 10:22:47PM +0800, Peng Tao wrote:
> What about letting fsync() on dir recursively fsync() all
> files/sub-dirs in the dir?
> Then apps can unpack package in a temp dir, fsync(), and rename.

There are programs to do who execute fsync() on a directory, and they
do not expect a recursive fsync() on all files/subdirectories in a
directory.

At least for Linux, sync() is synchronous and will do what you want.
There is unfortunately not a portable way to do what you want short of
fsync'ing all of the files after they are written.  This case is
mostly optimized under ext3/4 (we could do a bit better for ext4, but
the performance shouldn't be disastrous --- certainly much better than
write a file, fsync, rename a file, repeat).

					- Ted

  reply	other threads:[~2010-05-10 14:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 13:49 [Bug 15910] New: zero-length files and performance degradation bugzilla-daemon
2010-05-05 18:54 ` [Bug 15910] " bugzilla-daemon
2010-05-06  4:06 ` bugzilla-daemon
2010-05-06  4:18 ` bugzilla-daemon
2010-05-09 18:19 ` bugzilla-daemon
2010-05-10  2:56   ` tytso
2010-05-10 14:22     ` Peng Tao
2010-05-10 14:34       ` tytso [this message]
2010-05-10  3:49 ` bugzilla-daemon
2010-05-10 14:36 ` bugzilla-daemon
2010-05-10 14:52 ` bugzilla-daemon
2010-05-10 17:23 ` bugzilla-daemon
2010-05-10 22:33 ` bugzilla-daemon
2011-03-07  0:30 ` bugzilla-daemon
2011-03-09 19:09 ` bugzilla-daemon

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=20100510143433.GS18762@thunk.org \
    --to=tytso@mit.edu \
    --cc=bergwolf@gmail.com \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-ext4@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.