[linux-cifs-client] [PATCH] cifs: fix slab memory pool destruction order

Akinobu Mita akinobu.mita at gmail.com
Sun Jun 3 11:55:04 GMT 2007


Slab cache used as memory pool can not be destroyed before the memory
pool destruction. Because the memory pool still holds some objects and
kmem_cache_destroy() says "Can't free all objects".

Cc: Steve French <sfrench at samba.org>
Signed-off-by: Akinobu Mita <akinobu.mita at gmail.com>

Index: 2.6-mm/fs/cifs/cifsfs.c
===================================================================
--- 2.6-mm.orig/fs/cifs/cifsfs.c
+++ 2.6-mm/fs/cifs/cifsfs.c
@@ -825,8 +825,8 @@ cifs_init_mids(void)
 				sizeof (struct oplock_q_entry), 0,
 				SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (cifs_oplock_cachep == NULL) {
-		kmem_cache_destroy(cifs_mid_cachep);
 		mempool_destroy(cifs_mid_poolp);
+		kmem_cache_destroy(cifs_mid_cachep);
 		return -ENOMEM;
 	}
 


More information about the linux-cifs-client mailing list