From: Andreas Dilger <adilger@turbolabs.com>
To: Andi Kleen <ak@suse.de>
Cc: Linus Torvalds <torvalds@transmeta.com>,
John Levon <movement@marcelothewonderpenguin.com>,
linux-kernel@vger.kernel.org, davej@suse.de
Subject: Re: [PATCH] Fix 2.5.3pre reiserfs BUG() at boot time
Date: Fri, 25 Jan 2002 13:38:14 -0700 [thread overview]
Message-ID: <20020125133814.U763@lynx.adilger.int> (raw)
In-Reply-To: <20020125180149.GB45738@compsoc.man.ac.uk> <Pine.LNX.4.33.0201251006220.1632-100000@penguin.transmeta.com> <20020125204911.A17190@wotan.suse.de>
In-Reply-To: <20020125204911.A17190@wotan.suse.de>; from ak@suse.de on Fri, Jan 25, 2002 at 08:49:11PM +0100
On Jan 25, 2002 20:49 +0100, Andi Kleen wrote:
> @@ -810,11 +832,8 @@
> struct list_head *p;
>
> list_for_each(p, &cache_chain) {
> - kmem_cache_t *pc = list_entry(p, kmem_cache_t, next);
> -
> - /* The name field is constant - no lock needed. */
> - if (!strcmp(pc->name, name))
> - BUG();
> + kmem_cache_t *pc;
> + pc = list_entry(p, kmem_cache_t, next);
> }
> }
>
So, what exactly does the above do now (hint: p and pc are both local
so they cannot be referenced anywhere else)? It used to check that you
weren't trying to add two caches with the same name. This isn't
possible with caches from broken modules anymore as they have no name.
In the end, it is mostly irrelevant if we have duplicate names in the
slab cache, because you can't "attach" to a cache by name (you can
only "create" a cache and access it via a pointer). We may as well
just remove the whole loop above, since it doesn't do anything anymore.
> + name = cachep->name;
> + {
> + char tmp;
> + if (get_user(tmp, name))
> + name = "broken";
> + }
When calling kmem_cache_destroy() on a non-empty slab we should just
malloc some memory with the old cache name + "_leaked" for the name
pointer. At least then we have a sane chance of figuring out what caused
the problem, instead of having a bunch of "broken" entries in the table,
and remove the above "broken" check entirely (we will always have a name).
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
next prev parent reply other threads:[~2002-01-25 20:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-25 17:28 Andi Kleen
2002-01-25 18:01 ` John Levon
2002-01-25 18:08 ` Linus Torvalds
2002-01-25 18:31 ` Andreas Dilger
2002-01-25 18:46 ` Hans Reiser
2002-01-25 19:49 ` Andi Kleen
2002-01-25 20:38 ` Andreas Dilger [this message]
2002-01-25 22:15 ` Andi Kleen
2002-01-25 22:32 ` eth0: NULL pointer encountered in RX ring, skipping Andrea Ferraris
2002-01-25 22:59 ` Jeff Garzik
2002-01-26 10:11 ` Andrea Ferraris
2002-01-26 15:24 ` OPS: " Andrea Ferraris
2002-01-25 22:41 ` [PATCH] Fix 2.5.3pre reiserfs BUG() at boot time Andreas Dilger
2002-01-26 7:24 ` Kai Henningsen
2002-01-27 23:02 ` Alessandro Suardi
2002-01-28 0:01 ` Andi Kleen
2002-01-28 11:07 ` Jens Axboe
2002-01-28 14:53 ` Andi Kleen
2002-01-28 14:54 ` Jens Axboe
2002-01-29 13:14 ` Alessandro Suardi
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=20020125133814.U763@lynx.adilger.int \
--to=adilger@turbolabs.com \
--cc=ak@suse.de \
--cc=davej@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=movement@marcelothewonderpenguin.com \
--cc=torvalds@transmeta.com \
/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®