Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 2002 10:45:10 -0700 (PDT)
From:      Scott Hess <scott@avantgo.com>
To:        fs@freebsd.org
Subject:   Re: Filesystem
Message-ID:  <Pine.LNX.4.44.0205031027540.4240-100000@river.avantgo.com>
In-Reply-To: <Pine.LNX.4.44.0205030959270.3919-100000@river.avantgo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.44.0205031027540.4240-100000>