From owner-freebsd-fs Fri May 3 11: 3:52 2002 Delivered-To: freebsd-fs@freebsd.org Received: from swan.prod.itd.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 0799537B400 for ; Fri, 3 May 2002 11:03:42 -0700 (PDT) Received: from pool0248.cvx40-bradley.dialup.earthlink.net ([216.244.42.248] helo=mindspring.com) by swan.prod.itd.earthlink.net with esmtp (Exim 3.33 #2) id 173hP7-0005bi-00; Fri, 03 May 2002 11:03:37 -0700 Message-ID: <3CD2D0DC.9B636A54@mindspring.com> Date: Fri, 03 May 2002 11:03:08 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Scott Hess Cc: "Vladimir B. Grebenschikov" , fs@freebsd.org Subject: Re: Filesystem References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Scott Hess wrote: > Looks to me like Vladimir's supposition is correct for FFS: > > scott@ganja2:test> uname -a > FreeBSD ganja2.avantgo.com 4.5-RELEASE-p4 FreeBSD 4.5-RELEASE-p4 #0: Tue Apr 23 16:28:25 PDT 2002 > root@agdev2.avantgo.com:/avantgo/obj/avantgo/src/sys/GANJA i386 > scott@ganja2:test> perl -e 'for (my $ii = 0; 1; $ii++) { mkdir(sprintf("%06u", $ii), 0755) || die "$!";}' > Too many links at -e line 1. > scott@ganja2:test> ls | wc > 32765 32765 229355 > scott@ganja2:test> ls -ld . > drwxr-xr-x 32767 scott wheel 530944 May 3 10:23 . > > [32767 is 32765 links from .. of subdirs, 1 for . of test, one for test in > parent directory.] Crap. Forgot about the link count. Yes, it's an int16_t. It looks like it's signed for a single compare, so it could be made unsigned, and the compare done against both 0 and 65535 (and/or prevented from underflowing in the first place). If you look at the stat man page, there's an nlink_t. This is a u_int16_t. So minimally, there is a limit of 65535 on all FS's, period. I believe this limit is common to all UNIX systems that use hard links to do ".." processing. Technically, it should be possible to do this with affecting link count. However, it's really easy to open a directory and determine if there ar substirectories by examining the link count on it, and to know how many there are by examining the link count on it. In any case, it's still an incredibly bad idea to have even a tenth of that man objects in a single directory, period. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message