[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: is there a fix for "Too many levels of symbolic links"

In message <39r81zjmgj fsf dzsca013 lss emc com>you write:
>cat: mytestfile: Too many levels of symbolic links

It's been my observation that this won't be fixed.
I've run into the same problem, not to mention I believe Oracle did too.

If you look in /usr/include/sys/param.h you'll find the following:
#define        MAXSYMLINKS     20

Just like Sun (and HP).  The only difference is that this number is ignored
by the kernel.  In fact if you look in the kernel /usr/src/linux/fs/namei.c
you'll find the following comment:

 * This limits recursive symlink follows to 8, while
 * limiting consecutive symlinks to 40.

- - ---- but if you actually look at the code a few lines later you get

if (current->link_count >= 5)
      goto loop;
if (current->total_link_count >= 40)
      goto loop;

Bottom line.  Any nesting greater than 5 fails.
The fix - recompile the kernel with the 5 replaced by 10.  
It used to be claimed that since the name resolution was done with a recursive
algorithm, there was concern about using more kernel stack space.  But
I believe the recursive algorithm has been removed.  Just the prohibition 
for a nesting level greater than 5 remains.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]