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 11:59:55 +0200 (MEST) [thread overview]
Message-ID: <UTC200206160959.g5G9xtM29126.aeb@smtp.cwi.nl> (raw)
On Sun, 16 Jun 2002 Andries.Brouwer@cwi.nl wrote:
> > Wrong. That breaks for anything with ->follow_link() that
> > can't be expressed as a single lookup on some path.
>
> I don't know what interesting out-of-tree filesystems you
> have in mind, but it looks like this would work for all
> systems in the current tree.
Trivial counterexample: procfs.
That is trivially handled:
static inline int
do_follow_link(struct dentry *dentry, struct nameidata *nd) {
const char *link = NULL;
struct page *page = NULL;
int err;
...
err = dentry->d_inode->i_op->prepare_follow_link(dentry, nd, &link, &page);
if (nd->flags & FOLLOW_DONE)
nd->flags &= ~FOLLOW_DONE;
else if (err = 0)
err = __vfs_follow_link(nd, link);
if (page) {
kunmap(page);
page_cache_release(page);
}
...
return err;
}
You must come with more serious objections before I believe your
claim that this doesn't work.
----------
> You are replacing kdev_t by struct block device *, that I
> consider as a refcounted reference to the device. Fine.
> But kdev_t is created by the driver, at the moment the
> device is detected, while struct block device * is created
> at open() time. Thus, the question arises where you plan to
...
> store permanent device data like size or sectorsize.
Sector size is kept in the queue. Disk size - in per-disk objects
that are yet to be introduced in the tree.
Yes - it is these per-disk objects that I was referring to.
Recently I was polishing some SCSI code, and the next step
would have been unification with some IDE code that did precisely
the same things in an entirely different way. But in order to
remove this driver code I needed what I still think of as kdev_t
structs. So you will be introducing them after all. Good.
----------
Notice that your "permanent" data is not quite permanent - e.g.
information about partitioning can be lost (in all kernels since
2.0, if not earlier) at any moment when nobody has devices opened.
rmmod -a and there you go...
IMO correct approach to such data is that it's generated on demand
(as it is right now - again, consider modular driver; then we don't
see _anything_ about devices until somebody attempts to open one
of them and triggers module loading)
Yes, when the disk is removed, or when the driver is removed
it does not matter that information is lost.
But it is very bad to generate a partition table on each open.
Indeed, it is wrong.
User space can tell the kernel what the partitions are.
Opening a disk device must not destroy that information.
So some permanent info of the gendisk type is needed.
Andries
next reply other threads:[~2002-06-16 10:00 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-16 9:59 Andries.Brouwer [this message]
2002-06-16 10:33 ` 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 13:13 Andries.Brouwer
2002-06-16 18:51 ` Alexander Viro
2002-06-16 10:56 Andries.Brouwer
2002-06-16 11:38 ` 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=UTC200206160959.g5G9xtM29126.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®