lkml.org 
[lkml]   [2002]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH+discussion] symlink recursion
On Wed, Jun 19, 2002 at 09:05:53AM -0700, Linus Torvalds wrote:

> Actually, the trip to the filesystem itself is not recursive. We only have
> one lookup _active_ at a time, so the stack depth is fairly well bounded.

In your previous letter you wanted to play semantical tricks with the
word recursive, even though you understood perfectly well what I meant
with "nonrecursive" (and you yourself used the same terminology in older
posts).

Now I hesitate whether I should react to the above statement.
Maybe this time there are semantical tricks with the word active,
but it sounds a bit as if you misunderstand the situation.

Let me state the facts instead of worrying about semantics.

The routine link_path_walk() in namei.c will call do_follow_link()
in case of a symlink, and this routine will call
dentry->d_inode->i_op->follow_link(),
say, nfs_follow_link(), which calls vfs_follow_link(),
which calls link_path_walk(), etc.

You see that in a stack of N invocations, there will also
be N stack frames of foofs_follow_link().
So, yes, in the way I use recursive, routines like nfs_follow_link()
are indeed recursive: they end up calling themselves.

Last Sunday or so I gave a demo patch that takes the filesystems
out of the loop. Then symlink resolution is still recursive but
there will be at most one invocation of foofs_follow_link().

Yesterday I showed that it is also easy to avoid recursion altogether.

These are independent stages, and one might consider doing one
and not the other.

Andries


[Now that I write anyway, let me address others:
(i) The "depth" that is limited by 5 is the number of symlinks
that is being resolved at the same time; there is a much larger
limit (40) on the total number of symlinks resolved during a
path lookup.
(ii) 5 sounds like a very small number, but a Google search turns
up very few people who have problems. It would be nice to be able
to say "echo 32 > /proc/sys/fs/max-symlink-depth" to get a different
limit, and with the present implementation that is impossible,
but the fact remains that it is not a real problem that many people
have problems with. This is more a scalability problem.]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.063 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site