Re: Bug in kmem_cache_create with duplicate names

From: Peter W. Morreale (morreale_at_radiantdata.com)
Date: 12/07/04

  • Next message: Eran Mann: "Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm2-V0.7.32-2"
    Date:	Tue, 07 Dec 2004 10:57:42 -0700
    To: Steven Rostedt <rostedt@goodmis.org>
    
    

    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.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Eran Mann: "Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm2-V0.7.32-2"

    Relevant Pages

    • RE: RFC: Cleanup / small fixes to hugetlb fault handling
      ... David Gibson wrote on Tuesday, October 25, 2005 7:49 PM ... rather than finding it in the page cache already. ... I don't see a bug that you are seeing. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Bug in kmem_cache_create with duplicate names
      ... > Is it really necessary to BUG on creating a cache with a duplicate name? ... Duplicate name can just return NULL. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Bug in kmem_cache_create with duplicate names
      ... Is it really necessary to BUG on creating a cache with a duplicate name? ... but I didn't expect a simple module to crash the machine the way ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: DHCP weirdness - "Unicasting datagram to 0.0.0.0" ?
      ... >> a bug or a feature of the DHCP server that it behaves like this. ... As you observe, eventually the cache entry times out, gets ... I did try fiddling with the offer cache timeout, but it doesn't seem to help ... Is the DHCP server source going to be included in OpenSolaris? ...
      (comp.unix.solaris)
    • Re: DHCP weirdness - "Unicasting datagram to 0.0.0.0" ?
      ... > bug or a feature of the DHCP server that it behaves like this. ... It's a bug, number 6220012, the server gets confused about what's in its ... with x86 clients because the PXE boot process is more convoluted than ... As you observe, eventually the cache entry times out, gets ...
      (comp.unix.solaris)