mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: John Levon <movement@marcelothewonderpenguin.com>,
	Andi Kleen <ak@suse.de>,
	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 11:31:18 -0700	[thread overview]
Message-ID: <20020125113118.S763@lynx.adilger.int> (raw)
In-Reply-To: <20020125180149.GB45738@compsoc.man.ac.uk> <Pine.LNX.4.33.0201251006220.1632-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0201251006220.1632-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Fri, Jan 25, 2002 at 10:08:56AM -0800

On Jan 25, 2002  10:08 -0800, Linus Torvalds wrote:
> I would prefer instead just avoiding the copy altogether, and just save
> the name pointer - with no length restrictions.
> 
> Right now the code has the comment
> 
>    /* Copy name over so we don't have problems with unloaded modules */

Yes, I put that in.

> but that was written before "kmem_cache_destroy()" existed, and we should
> long ago have fixed any modules that don't properly destroy their caches
> when they exit (and yes, I know the difference between "should" and "did",
> but that's not an excuse for a bad interface).

The problem is that if, for some reason, the cache is NOT empty when you
call kmem_cache_destroy(), it will not be freed, but the module exits
anyways.  Then, any access to /proc/slabinfo will OOPS.

Yes, code should be written correctly so that its slab is empty when it
exits, but I'd rather have a _bit_ of safety here so that you can at
least check slabinfo when you get a kernel message "slab is not empty"
(or whatever it is) so you can at least try and investigate the problem.

The other alternative is to BUG with enough information to figure out
the status of this cache if you try to free a non-empty cache.  At
least then you would get some data at the time the real problem happens
as opposed to killing some random process later that tries to read
slabinfo.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


  reply	other threads:[~2002-01-25 18:32 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 [this message]
2002-01-25 18:46     ` Hans Reiser
2002-01-25 19:49     ` Andi Kleen
2002-01-25 20:38       ` Andreas Dilger
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=20020125113118.S763@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®