duplicate entry check in kmem_cache_create

From: Steve French (smfrench@austin.rr.com)
Date: Wed Jun 18 2003 - 18:08:05 EST


Is there a recommended way to check to see if a slab cache with
a specific name exists before calling kmem_cache_create?

I was able to force it into the BUG() at about line 1160 of slab.c by
removing my
module (rmmod -f) while some of my slab cache objects (e.g. private inode
info) were still in use, and then reloading my module which called
kmem_cache_create with a name that already existed. I would
like to exit module init code with a more graceful error if I
could easily detect that my slab cache objects were not deleted
(since if I proceed farther in my module init code it will hit the
BUG statement on 1160 of slab.c)

Any easy way to check?

-
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/



This archive was generated by hypermail 2b29 : Mon Jun 23 2003 - 22:00:27 EST