Re: [PATCH] mm/slab_common: fix slab_caches list corruption after kmem_cache_destroy()

From: Matthew Wilcox
Date: Fri Sep 08 2023 - 21:17:05 EST


On Fri, Sep 08, 2023 at 07:06:49PM -0400, Rafael Aquini wrote:
> This patch fixes this issue by properly checking shutdown_cache()'s
> return value before taking the kmem_cache_release() branch.

Is this the right way to fix this problem? If the module destroys the
slab cache, it's not going to be possible to free any of the objects
still allocated from the cache. I feel that we should treat this as
implicitly freeing all the objects that were allocated from the cache
rather than saying the cache is still busy.