From owner-freebsd-fs Fri May 3 10:45:20 2002 Delivered-To: freebsd-fs@freebsd.org Received: from kali.avantgo.com (shadow.avantgo.com [64.157.226.66]) by hub.freebsd.org (Postfix) with ESMTP id 5F86437B41C for ; Fri, 3 May 2002 10:45:11 -0700 (PDT) Received: from river.avantgo.com ([10.11.30.114]) by kali.avantgo.com with Microsoft SMTPSVC(5.0.2195.3779); Fri, 3 May 2002 10:45:11 -0700 Date: Fri, 3 May 2002 10:45:10 -0700 (PDT) From: Scott Hess To: fs@freebsd.org Subject: Re: Filesystem In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-OriginalArrivalTime: 03 May 2002 17:45:11.0178 (UTC) FILETIME=[45D1D6A0:01C1F2CA] 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 Hmm. And I just noticed an interesting effect from softupdates (I think). If I follow my perl script with 'ls | xargs rmdir', and then immediately run the perl script again, I get the 'Too many links' error with fewer directories created. So: scott@ganja2:test> perl -e 'for (my $ii = 0; 1; $ii++) { mkdir(sprintf("%06u", $ii), 0755) || die "$!";}' ; ls | wc Too many links at -e line 1. 32765 32765 229355 scott@ganja2:test> ls | xargs rmdir ; perl -e 'for (my $ii = 0; 1; $ii++) { mkdir(sprintf("%06u", $ii), 0755) || die "$!";}' ; ls | wc Too many links at -e line 1. 3212 3212 22484 The number of directories created by the second pass varies from run to run. Sometimes it's even all 32765 directories... Later, scott On Fri, 3 May 2002, 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.] > > Later, > scott > > On Fri, 3 May 2002, Terry Lambert wrote: > > "Vladimir B. Grebenschikov" wrote: > > > > > > χ Thu, 02.05.2002, Χ 19:25, Zhihui Zhang ΞΑΠΙΣΑΜ: > > > > You can create as many entries as you want in a directory. > > > > > > It is true only for files. > > > > > > But original question was about subdirectories. > > > > > > Actually there are limit on number of hardlinks for file(or dirs) and > > > this limit about 32k > > > > > > Each subdirectory hardlinks it's '..' to parent directory so, you can't > > > create more then 32k subdirectories (it is true for 3.x) > > > but I don't know how with this problem on -STABLE and -CURRENT ? > > > > > > Anybody knows ? > > > > The limit you are complaining about are FAT/VFAT specific. > > > > All FS's have their own limits. > > > > In FFS, a directory is a file. Therefore you are limited by > > the number of files. THe number of files is limited by disk > > space and reserved space for inodes. > > > > -- Terry > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-fs" in the body of the message > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message