Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Mar 1997 04:39:51 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-hackers@FreeBSD.ORG, jez@netcraft.co.uk
Subject:   Re: Hard Link Count too small!
Message-ID:  <199703071739.EAA23773@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>    Specifically, the following will create a directory with 32765
>subdirectories (not including `.', & `..') before bailing:
>
>    % mkdir tmp
>    % cd tmp
>    % perl -e '1 while (mkdir(++$c, 0755))'
>
>(you might want to mount the filesystem async beforehand :-)

I have some POSIX performance tests that do this several times.  They
take too long.  They take much too long if the filesystem is not async
mounted.

>    % ls -fa | wc -l 
>       32767

>So, could someone more knowledgeable about filesystem internals tell me why
>st_nlink is behaving like a signed short, and what I can do about it?

The limit is (bogusly) given by LINK_MAX in <sys/syslimits.h>.  This is
supposed to give the system-wide limit, but it is really only the ufs
limit.  You can probably safely increase it to slightly less than 65535.
Don't make it 65535, since ufs_rename() temporarily increases the link
count without checking the limit.

Bruce



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