mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries Brouwer <aebr@win.tue.nl>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Daniel Phillips <phillips@bonn-fries.net>,
	Andries.Brouwer@cwi.nl, Alexander Viro <viro@math.psu.edu>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH+discussion] symlink recursion
Date: Wed, 19 Jun 2002 20:18:14 +0200	[thread overview]
Message-ID: <20020619181814.GA16548@win.tue.nl> (raw)
In-Reply-To: <Pine.LNX.4.44.0206190900560.2053-100000@home.transmeta.com>

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.]

  reply	other threads:[~2002-06-19 18:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-18 22:19 Andries.Brouwer
2002-06-18 23:57 ` Linus Torvalds
2002-06-19  7:12   ` William Lee Irwin III
2002-06-19 11:48   ` Rogier Wolff
2002-06-19 14:44   ` Daniel Phillips
2002-06-19 16:05     ` Linus Torvalds
2002-06-19 18:18       ` Andries Brouwer [this message]
2002-06-19 18:55         ` Linus Torvalds
2002-06-19 19:14           ` David Mosberger
2002-06-19 22:06             ` David S. Miller
2002-06-19  7:02 Andries.Brouwer
2002-06-19 20:01 Andries.Brouwer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020619181814.GA16548@win.tue.nl \
    --to=aebr@win.tue.nl \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillips@bonn-fries.net \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®