How to increase max symlink limit in RHEL

rhel5symlink

I am running into the following Linux error: Too many levels of symbolic links.
This seems to be caused by the system limit of 8 maximum link-chain size, and I'm looking for a way to increase this limit.

Some background:
I am writing a system which makes use of symlinks to pass on file resources between working elements. This results in long chains of symlinks (e.g. a->b->c->d->e...->z). I am creating a chain intentionally, as I'm interested in preserving this structure of who-provided what. It should be noted that this system is physically disconnected from the outside world, so I have practically no concerns for security or exploit prevention.

All help would be greatly appreciated!

Best Answer

Looks like you'll need to rebuild the kernel, modifying "MAX_NESTED_LINKS" in "namei.h". It's hard-coded, see line 808 of fs/namei.c.

Note, of course, that the performance of symlinks is terrible, I hope you don't have to access these links very frequently...