linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Andi Kleen <andi@firstfloor.org>
Cc: Jan Kara <jack@suse.cz>, linux-ext4@vger.kernel.org
Subject: Re: Enabling h-trees too early?
Date: Fri, 21 Sep 2007 07:45:04 -0400	[thread overview]
Message-ID: <20070921114504.GM30221@thunk.org> (raw)
In-Reply-To: <p738x709yrh.fsf@bingen.suse.de>

On Fri, Sep 21, 2007 at 11:02:58AM +0200, Andi Kleen wrote:
> I assume you mean sort by inode, because sort by htree key would
> be as bad as htrees.
> 
> But wouldn't that break parallel readdir for a directory that just grows
> from <32/64K to over it?  e.g. if the sort moves already read 
> entries to after the  cursor readdir would return some entries twice.

No, it wouldn't break it because after snapshotting the tree, we would
only use the snapshot and not refer to the on-disk format until the
directory file handle is closed or there is an explicit lseek to 0.
To quote from the spec:

  If a file is removed from or added to the directory after the most recent
  call to the opendir() or rewinddir() function, whether a subsequent call to
  the readdir() function returns an entry for that file is unspecified.

So, if some program does the stupid thing and opens a directory,
doesn't use it for five hours, and in the meantime 2,000 files are
created, it's OK if we only return the set of files that were in
existence when the opendir() was originally called.  This makes us OK
in terms of spec conformance, and given that real life programs don't
do stuff this stupid, we should be fine.

					- Ted

      reply	other threads:[~2007-09-21 11:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 15:07 Enabling h-trees too early? Jan Kara
2007-09-19 17:02 ` Andreas Dilger
2007-09-19 18:24 ` Theodore Tso
2007-09-20 13:33   ` Jan Kara
2007-09-20 14:28     ` Theodore Tso
2007-09-20 14:58       ` Jan Kara
2007-09-20 15:14         ` Theodore Tso
2007-09-20 16:19           ` Jan Kara
2007-09-20 17:02             ` Theodore Tso
2007-09-21 13:49               ` Jan Kara
2007-09-21  9:02   ` Andi Kleen
2007-09-21 11:45     ` Theodore Tso [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=20070921114504.GM30221@thunk.org \
    --to=tytso@mit.edu \
    --cc=andi@firstfloor.org \
    --cc=jack@suse.cz \
    --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 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).