public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Peter W. Morreale" <morreale@radiantdata.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Randy.Dunlap" <rddunlap@osdl.org>
Subject: Re: Bug in kmem_cache_create with duplicate names
Date: Tue, 07 Dec 2004 10:57:42 -0700	[thread overview]
Message-ID: <41B5EF16.30107@radiantdata.com> (raw)
In-Reply-To: 1102437079.25841.275.camel@localhost.localdomain



Steven Rostedt wrote:

>On Tue, 2004-12-07 at 11:15 -0500, Arjan van de Ven wrote:
>
>  
>
>>>However, I agree with you.  I don't see a good reason for it.
>>>      
>>>
>>I do...
>>because if the registration gives success..... then you unregister it
>>later during module unload and the INITIAL user goes bang.
>>It's a bad bug. Don't do it. Fix your code ;)
>>
>>    
>>
>
>Your module should fail to load if you can't register a cache. If you
>are a good boy and check your return codes from the kmem_cache_create,
>you would know that the cache failed and not load the module.
>Otherwise, if it failed for other reasons, then you can be causing bugs
>later when you go to use it. 
>

This would preclude the use of a dynamic cache, not all initializations 
are performed during module
insertion.    It also breaks since there is no relationship between the 
size of the objects in the cache
and the cache name (which is causing the BUG).  

This BUG specifically means that you (or somebody else) allocated 
something and did not free it.  

That is broken.  FYC (Fix Yer Code ;-) is the answer.

>
>Now this raises the issue of name space, this will bug if two modules
>use the same cache name. If this happens with two different vendors,
>than the poor user will have to figure out who to blame.
>

No different than any other global namespace issue.

-PWM

-- 
Peter W. Morreale                            email: morreale@radiantdata.com
Director of Engineering                      Niwot, Colorado, USA
Radiant Data Corporation                     voice: (303) 652-0870 x108 
-----------------------------------------------------------------------------
This transmission may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution, or use of the information contained herein (including any
reliance thereon) is STRICTLY PROHIBITED. If you received this transmission
in error, please immediately contact the sender and destroy the material in
its entirety, whether in electronic or hard copy format. Thank you.




  reply	other threads:[~2004-12-07 17:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-07 15:40 Bug in kmem_cache_create with duplicate names Steven Rostedt
2004-12-07 15:33 ` Randy.Dunlap
2004-12-07 16:15   ` Arjan van de Ven
2004-12-07 15:42     ` Randy.Dunlap
     [not found]     ` <1102436777.25841.271.camel@localhost.localdomain>
2004-12-07 16:31       ` Steven Rostedt
2004-12-07 17:57         ` Peter W. Morreale [this message]
2004-12-07 18:24           ` Steven Rostedt
2004-12-07 16:21   ` Steven Rostedt

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=41B5EF16.30107@radiantdata.com \
    --to=morreale@radiantdata.com \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rddunlap@osdl.org \
    --cc=rostedt@goodmis.org \
    /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