Am Mit, 2002-01-30 um 11.14 schrieb Heinz-Josef Claes:
> Am Mit, 2002-01-30 um 11.02 schrieb Oleg Drokin:
> > Hello!
> >
> > On Wed, Jan 30, 2002 at 10:52:04AM +0100, Heinz-Josef Claes wrote:
> >
> > > this is not true. The maximum number of links in reiserfs 3.5 and 3.6 is
> > > 64535 (not 65535!). With ext2, it's exactly 32000. I wrote a program
> > > which uses heavly hard links, and had problems with this limit.
> > > Does anybody know, why these strange limits exist?
> > For reiserfs these limits are imposed by Linux type of nlink_t.
> > Which is unsigned short on all arches besides sparc (where it short int),
> > so you can have 65535 links on every arch except sparc, and 32767 links on
> > sparc.
>
> I'm running the following perl script (x.pl) on linux (same result for
> 3.5 and 3.6):
>
> #! /usr/bin/env perl
>
> open(FILE, "> a");
> close(FILE);
>
> $i = 0;
> while (1)
> {
> last unless link "a", "a$i";
> ++$i;
> }
>
>
> $ x.pl
> $ ls -l | more
> drwxr-xr-x 2 root root 1548888 Jan 30 11:14 .
> drwxr-xr-x 3 admin users 96 Jan 30 11:12 ..
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a0
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a1
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a10
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a100
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a1000
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a10000
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a10001
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a10002
> -rw-r--r-- 64535 root root 0 Jan 30 11:14 a10003
> etc.
>
> As you can see, it's not 65535 links, it's 643535. Same result for
> reiserfs 3.5 and reiserfs 3.6.
>
> regards,
> Heinz-Josef Claes
>
>
Sorry, I forgot to say, it's kernel 2.4.17.