Daniele Orlandi wrote: > I'm looking at proto_unregister() in linux-2.6.13: > > Il calls kmem_cache_destroy() while holding proto_list_lock: > > void proto_unregister(struct proto *prot) > { > write_lock(&proto_list_lock); > > if (prot->slab != NULL) { > kmem_cache_destroy(prot->slab); > > > However, kmem_cache_destroy() may sleep: > > /* Find the cache in the chain of caches. */ > down(&cache_chain_sem); > ^^^^^^^^^^^^^^^^^^^^^^^ > > Am I seeing it right? You're right, good catch. This patch fixes it by moving the lock down to the list-operation which it is supposed to protect.