User: Password:
Subscribe / Log in / New account

adjusting the problem vs fixing it

adjusting the problem vs fixing it

Posted Jul 2, 2004 3:25 UTC (Fri) by giraffedata (subscriber, #1954)
In reply to: Supporting deeper symbolic links by bronson
Parent article: Supporting deeper symbolic links

Given that the lookup does not fail gracefully if you run out of stack (behavior is undefined), there really ought to be a more formal control on the amount of stack space used. Just saying, "About 5 should be safe" is not adequate, and lowering the stack usage and saying, "now 8 should probably be OK" is shamelessly perpetuating the problem.

Requiring the filesystem code and VFS code to be so intimately familiar with each other's use of stack space to avoid crashing the kernel is asking too much.

I too would expect an iteration to be the right fix. But if that's not practical, then the limit should be on the amount of stack space left, not the number of times a symbolic link has been followed. And it's actually cleaner to check how much stack space is left than to do the count. The code today doesn't do pure recursion; it has a special global (per-process) variable (current->link_count) it uses to determine when this particular recursion has hit its limit.

(Log in to post comments)

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds