Messages in this thread | | | Date | Tue, 14 Apr 1998 09:32:09 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: symlinks. |
| |
On Tue, 14 Apr 1998, Adam D. Bradley wrote: > > Hmm... comments in the code (fs/namei.c) claim:
The comment is simply wrong, it's a remnant from a very early first implementation of the dcache. Ignore the comment, the code is correct and does it recursively.
Changing it to iterate would be fine, but is much harder to do than it initially looks. If you do change it, make _sure_ that recursive symlinks work in the _middle_ of a symlink traversal - ie you cannot and must not do symlinks as "tailcall recursion" because while that actually works for a huge percentage of how symlinks are used it is not how symlinks actually work.
In short, it needs a lookup stack - we're using recursion to get that "for free", and any iterative version would have to implement the symlink lookup stack by hand.
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |