Skip to contentSkip to conversation

max symlink = 5? ?bug? ?feature deficit?

DISCUSSION [email protected] 1 participant 1 message Feb 12, 2006

lore
Share & tools
lore
#0 lore raw

That limit should be a *recursion* limit only. Symlinks in the last component of a path are looked up iteratively (to save kernel stack space), but a symlink in the middle of a path can't be done tail-recursively.

E.g. in your example

Quoted 1 line

namei cpu/args.t

f: cpu/args.t
d cpu
l args.t -> ../op/args.t
d ..
l op -> ../t/op/

     d ..
     l t -> perldir/t
       l perldir -> perl-5.8.6
         l perl-5.8.6 -> ../build/perl-5.8.6
           d ..
           l build -> BUILD
             d BUILD
           d perl-5.8.6
       d t
     d op

- args.t

Wow, what a symlink maze. The args.t -> ../op/args.t symlink is no problems, but it's the mess of directory links that the system has to traverse:

cpu/args.t
cpu/../op/args.t Tail-recursive expansion
cpu/../(../t/op)/args.t
cpu/../(../(perldir/t)/op)/args.t
cpu/../(../((perl-5.8.6)/t)/op)/args.t
cpu/../(../((../build/perl-5.8.6)/t)/op)/args.t
cpu/../(../((../(BUILD)/perl-5.8.6)/t)/op)/args.t

I'm supposing the initial level counts as 1, so 1+5 = 6 and blows the limit.

There's also an iteration limit, to stop a -> b -> c -> a cycles, but that's much higher. The recursion limit is a stack space issue.