Re: Bug in kmem_cache_create with duplicate names

From: Randy.Dunlap
Date: Tue Dec 07 2004 - 11:23:26 EST


Arjan van de Ven wrote:
On Tue, 2004-12-07 at 07:33 -0800, Randy.Dunlap wrote:

Steven Rostedt wrote:

Is it really necessary to BUG on creating a cache with a duplicate name?
Wouldn't it just be better to fail the create. The reason I mentioned
this is that I was writing some modules and after doing a cut and paste,
I forgot to change a name of a cache that was created by one module and
I used it in another existing module. So you can say that it was indeed
a bug, but did it really need to crash my machine? I aways check the
return codes in my modules, and I would have figured it out why it
failed, but I didn't expect a simple module to crash the machine the way
it did. Well anyway it did definitely show me where my bug was.

Yes, it does that.

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 ;)

Who said anything about the (second) registration giving success?
and how is it destroyed without a valid ptr to it?

--
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/