mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolinux.com>
To: linux-kernel@vger.kernel.org (Linux kernel development list)
Subject: Re: Maximum files per Directory
Date: Tue, 1 May 2001 16:57:02 -0600 (MDT)	[thread overview]
Message-ID: <200105012257.QAA27361@lynx.turbolabs.com> (raw)
In-Reply-To: <9cn80u$u19$1@cesium.transmeta.com> from "H. Peter Anvin" at May 01, 2001 01:58:06 PM

H. Peter Anvin writes:
> Not correct, there can't be more than 2^15 *directories* in a single
> directory.  I belive this is an ext2 limitation.

This is imposed by a number of issues:
- EXT2_LINK_MAX=32000 is checked for new subdirectories
- ext2 bg_used_dirs_count is a __u16
- inode->i_nlink (__kernel_nlink_t) is an unsigned short for some platforms

For stat (old interface) the st_nlinks count is also an unsigned short, so
we _should_ be able to increase EXT2_LINK_MAX to 65500 or so safely.  The
VFS will have problems if you increase the max link count over 65535 because
__kernel_nlink_t is __u16.

I see that reiserfs plays some tricks with the directory i_nlink count.
If you exceed 64536 links in a directory, it reverts to "1" and no longer
tracks the link count.

You will have problems with performance for directories this large on
stock ext2, unless you use Daniel Phillips' indexed directory patch.
I have tested 100k+ _files_ in a single directory without problems
(Daniel has tested 1M _files_ without problems).  I would NOT reccommend
doing this on your production mail server at this time, but it may be
worth testing at least...  It does not (yet) address the issue of lots of
subdirectories, but that is something that can be worked on at least.

http://kernelnewbies.org/~phillips/htree/

Cheers, Andreas
-- 
Andreas Dilger                               Turbolinux filesystem development
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

  reply	other threads:[~2001-05-01 22:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-01 20:48 Andreas Rogge
2001-05-01 20:58 ` H. Peter Anvin
2001-05-01 22:57   ` Andreas Dilger [this message]
2001-05-04 13:49     ` Chris Mason
2001-05-04 19:15       ` Andreas Dilger
2001-05-04 20:08         ` Chris Mason
2001-05-05 13:49           ` Jamie Lokier
2001-05-05 16:16             ` Chris Mason
2001-05-01 21:02 ` Alan Cox
2001-05-01 22:03   ` H. Peter Anvin
2001-05-02 10:22     ` Ingo Oeser
2001-05-02 16:13       ` H. Peter Anvin
2001-05-02 13:33   ` Ketil Froyn
2001-05-02  9:21 ` Henning P. Schmiedehausen

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=200105012257.QAA27361@lynx.turbolabs.com \
    --to=adilger@turbolinux.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®