Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Nov 2008 12:16:18 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Jeremy Chadwick <koitsu@freebsd.org>
Cc:        freebsd-questions@freebsd.org, no-spam@people.net.au
Subject:   Re: UFS2 limits
Message-ID:  <4916D492.5040406@infracaninophile.co.uk>
In-Reply-To: <20081109024046.GB27423@icarus.home.lan>
References:  <50261.1226194851@people.net.au> <20081109024046.GB27423@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig77EABF585AEBA7092B9FEB56
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Jeremy Chadwick wrote:

> I don't want to change the topic of discussion, but I *highly* recommen=
d
> you ***stop*** whatever it is you're doing that is creating such a
> directory structure.  Software which has to iterate through that
> directory using opendir() and readdir() will get slower and slower as
> time goes on.

With the implementation of UFS_DIRHASH the practical limit on the
size of directories is now a great deal larger. In particular
the slow down caused by linear search through the contents has been=20
eliminated.  See ffs(7).  10,000 files or sub-directories, whist
not a particularly elegant setup, is actually not unworkable
nowadays.

As for the maximum number of subdirectories it is possible to create
on UFS2 -- it is limited by the inode structure to a 16 bit quantity.

% jot 100000 1 | xargs mkdir -v
[...]
32725
32726
32727
32728
32729
32730
3273mkdir: 32766: Too many links
mkdir: 32767: Too many links
mkdir: 32768: Too many links
mkdir: 32769: Too many links
mkdir: 32770: Too many links
mkdir: 32771: Too many links
[...]

Which is 32768 - 2 for the '.' and '..' links.  Trying to create too
many subdirectories just results in mkdir failing: the filesystem
itself is not damaged.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW


--------------enig77EABF585AEBA7092B9FEB56
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAkkW1JkACgkQ8Mjk52CukIxzigCfZVknXz/lEidy3mkpFQEetq0y
doYAmwT+N/odOtvLH/vAczGyDBddVPER
=Qurc
-----END PGP SIGNATURE-----

--------------enig77EABF585AEBA7092B9FEB56--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4916D492.5040406>