From: Andries.Brouwer@cwi.nl
To: Andries.Brouwer@cwi.nl, viro@math.psu.edu
Cc: linux-kernel@vger.kernel.org
Subject: Re: [CHECKER] 37 stack variables >= 1K in 2.4.17
Date: Sun, 16 Jun 2002 15:13:25 +0200 (MEST) [thread overview]
Message-ID: <UTC200206161313.g5GDDPX00513.aeb@smtp.cwi.nl> (raw)
> First of all, _that_ is still recursive. And it's not easy
> to deal with - you need to release the object holding the link body
> (BTW, that can be almost anything - page, inode, kmalloc'ed area,
> vmalloc'ed area, etc.) after __vfs_follow_link() is done.
> And that means (at the very least) a stack of such objects,
> along with the information about their nature.
>
> Yes. But in the current tree only the cases page and kmalloc'ed area
> occur, and it is easy to transform the single occurrence of kmalloc'ed
> areas (jffs2) into a use of page.
That's simply not true. Of the top of my head - /proc/self.
Ah, yes - that has the string on stack.
That changes my inventory into: all callers except two use a page.
One (jffs2) uses a kmalloced area. One (/proc/self) has its data
on the stack.
Look, it's getting ridiculous.
That is a counterproductive reply.
You say "I tried to improve Linux three years ago and failed,
so you can forget it - no improvement is possible".
Of course improvement is possible. It always is.
Now we find that it is possible to change recursive symlink handling
into iterative handling. That is good, because the current limit of
5 is really a bit low. It bites every now and then.
Remains the question whether it can be done in a beautiful way.
Let us try. The basic object is a struct link_work that has dentry,
nameidata, link, page and flags and a pointer to the next such struct.
This is a reverse linked list: the thing we work on is in front,
the tail of the list is the thing we originally started to resolve.
The routine that does all this is
int do_link_work(struct link_work **lw) {
int err = 0;
while((*lw)->link) {
if (err == 0)
err = do_link_item(lw);
else
do_bad_link_item(lw);
}
return err;
}
where do_link_item() has as duty to handle the next part
of the pathname. That diminishes the work left, unless
that next part was a symlink, in which case resolution
of that is prepended to the list of work we have to do.
If something is wrong, do_bad_link_item() only releases resources.
Looks like a nice and clean setup.
Remains the question how to release the resources allocated
by the filesystems in prepare_follow_link().
There are various possibilities. General ones: the filesystem
provides a callback. Restricted ones: we ask the filesystem
to have one page as the only resource. Kludgy ones: we allow
some explicit short list, like page or kmalloc. Probably others.
But maybe you are not interested in thinking about such things.
You did it already.
Andries
next reply other threads:[~2002-06-16 13:13 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-16 13:13 Andries.Brouwer [this message]
2002-06-16 18:51 ` Alexander Viro
-- strict thread matches above, loose matches on Subject: below --
2002-06-17 11:07 Andries.Brouwer
2002-06-17 12:00 ` David Woodhouse
2002-06-16 22:05 Andries.Brouwer
2002-06-16 23:57 ` Alexander Viro
2002-06-16 20:41 Andries.Brouwer
2002-06-16 21:33 ` Andreas Dilger
2002-06-16 21:34 ` Alexander Viro
2002-06-17 10:09 ` David Woodhouse
2002-06-16 10:56 Andries.Brouwer
2002-06-16 11:38 ` Alexander Viro
2002-06-16 9:59 Andries.Brouwer
2002-06-16 10:33 ` Alexander Viro
2002-06-16 7:47 Andries.Brouwer
2002-06-16 8:36 ` Alexander Viro
2002-06-16 0:48 Andries.Brouwer
2002-06-16 1:08 ` Alexander Viro
2002-06-10 3:56 Dawson Engler
2002-06-12 8:43 ` Pavel Machek
2002-06-12 19:11 ` Nikita Danilov
2002-06-12 21:51 ` Benjamin LaHaise
2002-06-12 22:26 ` Alexander Viro
2002-06-12 22:38 ` Benjamin LaHaise
2002-06-12 22:44 ` Robert Love
2002-06-13 0:20 ` Alexander Viro
2002-06-13 8:30 ` Helge Hafting
2002-06-13 13:24 ` Roger Larsson
2002-06-14 10:06 ` Helge Hafting
2002-06-13 6:38 ` Dawson Engler
2002-06-13 6:59 ` Alexander Viro
2002-06-13 17:41 ` Daniel Phillips
2002-06-13 17:53 ` Alexander Viro
2002-06-13 18:45 ` Daniel Phillips
2002-06-13 17:56 ` Andi Kleen
2002-06-13 18:26 ` Alexander Viro
2002-06-13 19:01 ` Andi Kleen
2002-06-14 0:05 ` William Lee Irwin III
2002-06-13 21:50 ` Dawson Engler
2002-06-13 22:43 ` Oliver Xymoron
2002-06-14 0:25 ` Alexander Viro
2002-06-13 6:36 ` Dawson Engler
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=UTC200206161313.g5GDDPX00513.aeb@smtp.cwi.nl \
--to=andries.brouwer@cwi.nl \
--cc=linux-kernel@vger.kernel.org \
--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®