All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Tomas Hruby <thruby@few.vu.nl>
Cc: Erik Mouw <erik@harddisk-recovery.com>, linux-fsdevel@vger.kernel.org
Subject: Re: ext2/3 subdirectory limit [WAS: Choosing and tuning Linux file systems]
Date: Mon, 26 Jun 2006 08:54:35 -0400	[thread overview]
Message-ID: <20060626125435.GA3911@thunk.org> (raw)
In-Reply-To: <20060626123635.GA15200@fspc268>

On Mon, Jun 26, 2006 at 02:36:35PM +0200, Tomas Hruby wrote:
> I was always wondering why it increases link_count of the parent
> directory when creating a subdirectory. It is clear that .. points
> to the parent, but the subdirectory cannot exist without its parent
> and you cannot delete the parent if it is not empty. Correct me if I
> am wrong.
> 
> What is the link_count (incremented by subdirectories) used for? Is
> it ext2/3 specific or should it be implemented in such a way by
> other FS too? I am asking becuse I see no reason why to do so in our
> FS.

No, it's not ext2/3 specific; it's an old Unix tradition.  I've heard
reports of programs that attempt to optimize recursive descents by
counting the number of directories found so far and comparing it with
st_nlinks.  This is dangerous since it's possible for directories to
be created during the readdir(), and in any case not all filesystems
do follow this behavior.  So preserving it just to keep application
programs from breaking is probably a bad idea; in the case of ext2/3
we've been preserving it mainly because to do otherwise would cause
e2fsck to complain.  

We could create an rocompat feature which disabled this, or which
causes st_nlink above 32000 to mean "infinity"; such patches have
existed, but in practice it's relatively rare that people actually
find this to be a limitation, so none of the patches have managed to
achieve the necessary activation energy to actually get integrated
into both the kernel and e2fsprogs.

						- Ted

  parent reply	other threads:[~2006-06-26 12:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-25 22:00 Choosing and tuning Linux file systems Valerie Henson
2006-06-25 22:13 ` Matthew Wilcox
2006-06-25 22:26 ` Arjan van de Ven
2006-06-26  7:22 ` Neil Brown
2006-06-26  9:04 ` Nate Diller
2006-06-27 18:46   ` Valerie Henson
2006-06-26 11:10 ` Erik Mouw
2006-06-26 12:36   ` ext2/3 subdirectory limit [WAS: Choosing and tuning Linux file systems] Tomas Hruby
2006-06-26 12:35     ` Arjan van de Ven
2006-06-26 12:54     ` Theodore Tso [this message]
2006-06-26 16:25       ` Andreas Dilger
2006-06-26 17:35       ` Chris Wedgwood
2006-06-26 21:03         ` Tomas Hruby
2006-06-26 21:03           ` Chris Wedgwood
2006-06-26 21:13             ` H. Peter Anvin
2006-06-26 12:59     ` Erik Mouw
2006-06-26 21:09       ` Tomas Hruby
     [not found] ` <20060626091357.GQ5817@schatzie.adilger.int>
2006-06-26 22:01   ` Choosing and tuning Linux file systems Valerie Henson

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=20060626125435.GA3911@thunk.org \
    --to=tytso@mit.edu \
    --cc=erik@harddisk-recovery.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=thruby@few.vu.nl \
    /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.