aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2006-09-27 04:49:40 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 11:26:10 -0400
commit1a1d92c10dd24bbdc28b3d6e2d03ec199dd3a65b (patch)
treefade83955f75e718e39153d6f81d221403338bed
parentf52720ca5f48574e347dff35ffe6b389ace61537 (diff)
[PATCH] Really ignore kmem_cache_destroy return value
* Rougly half of callers already do it by not checking return value * Code in drivers/acpi/osl.c does the following to be sure: (void)kmem_cache_destroy(cache); * Those who check it printk something, however, slab_error already printed the name of failed cache. * XFS BUGs on failed kmem_cache_destroy which is not the decision low-level filesystem driver should make. Converted to ignore. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/acpi/osl.c2
-rw-r--r--drivers/infiniband/core/mad.c5
-rw-r--r--drivers/usb/host/uhci-hcd.c8
-rw-r--r--fs/adfs/super.c3
-rw-r--r--fs/affs/super.c3
-rw-r--r--fs/befs/linuxvfs.c4
-rw-r--r--fs/bfs/inode.c3
-rw-r--r--fs/cifs/cifsfs.c20
-rw-r--r--fs/coda/inode.c3
-rw-r--r--fs/efs/super.c3
-rw-r--r--fs/ext2/super.c3
-rw-r--r--fs/ext3/super.c3
-rw-r--r--fs/fat/cache.c3
-rw-r--r--fs/fat/inode.c3
-rw-r--r--fs/hfs/super.c3
-rw-r--r--fs/hfsplus/super.c3
-rw-r--r--fs/hpfs/super.c3
-rw-r--r--fs/isofs/inode.c4
-rw-r--r--fs/minix/inode.c3
-rw-r--r--fs/ncpfs/inode.c3
-rw-r--r--fs/nfs/direct.c3
-rw-r--r--fs/nfs/inode.c3
-rw-r--r--fs/nfs/pagelist.c3
-rw-r--r--fs/nfs/read.c3
-rw-r--r--fs/nfs/write.c3
-rw-r--r--fs/nfsd/nfs4state.c5
-rw-r--r--fs/ntfs/super.c28
-rw-r--r--fs/ocfs2/dlm/dlmfs.c4
-rw-r--r--fs/qnx4/inode.c4
-rw-r--r--fs/reiserfs/super.c4
-rw-r--r--fs/romfs/inode.c3
-rw-r--r--fs/smbfs/inode.c3
-rw-r--r--fs/smbfs/request.c3
-rw-r--r--fs/udf/super.c3
-rw-r--r--fs/ufs/super.c3
-rw-r--r--fs/xfs/linux-2.6/kmem.h4
-rw-r--r--ipc/mqueue.c5
-rw-r--r--mm/shmem.c3
-rw-r--r--net/sunrpc/rpc_pipe.c3
-rw-r--r--net/sunrpc/sched.c8
40 files changed, 53 insertions, 130 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 507f051d1cef..20beea778ea2 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1079,7 +1079,7 @@ acpi_status acpi_os_purge_cache(acpi_cache_t * cache)
1079 1079
1080acpi_status acpi_os_delete_cache(acpi_cache_t * cache) 1080acpi_status acpi_os_delete_cache(acpi_cache_t * cache)
1081{ 1081{
1082 (void)kmem_cache_destroy(cache); 1082 kmem_cache_destroy(cache);
1083 return (AE_OK); 1083 return (AE_OK);
1084} 1084}
1085 1085
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 082f03c158f0..493f4c65c7a2 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -2987,10 +2987,7 @@ error1:
2987static void __exit ib_mad_cleanup_module(void) 2987static void __exit ib_mad_cleanup_module(void)
2988{ 2988{
2989 ib_unregister_client(&mad_client); 2989 ib_unregister_client(&mad_client);
2990 2990 kmem_cache_destroy(ib_mad_cache);
2991 if (kmem_cache_destroy(ib_mad_cache)) {
2992 printk(KERN_DEBUG PFX "Failed to destroy ib_mad cache\n");
2993 }
2994} 2991}
2995 2992
2996module_init(ib_mad_init_module); 2993module_init(ib_mad_init_module);
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index b7402ceb3e93..eb4eab98e8bf 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -913,8 +913,7 @@ static int __init uhci_hcd_init(void)
913 return 0; 913 return 0;
914 914
915init_failed: 915init_failed:
916 if (kmem_cache_destroy(uhci_up_cachep)) 916 kmem_cache_destroy(uhci_up_cachep);
917 warn("not all urb_privs were freed!");
918 917
919up_failed: 918up_failed:
920 debugfs_remove(uhci_debugfs_root); 919 debugfs_remove(uhci_debugfs_root);
@@ -930,10 +929,7 @@ errbuf_failed:
930static void __exit uhci_hcd_cleanup(void) 929static void __exit uhci_hcd_cleanup(void)
931{ 930{
932 pci_unregister_driver(&uhci_pci_driver); 931 pci_unregister_driver(&uhci_pci_driver);
933 932 kmem_cache_destroy(uhci_up_cachep);
934 if (kmem_cache_destroy(uhci_up_cachep))
935 warn("not all urb_privs were freed!");
936
937 debugfs_remove(uhci_debugfs_root); 933 debugfs_remove(uhci_debugfs_root);
938 kfree(errbuf); 934 kfree(errbuf);
939} 935}
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index 959dbf1f8e63..9ade139086fc 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -251,8 +251,7 @@ static int init_inodecache(void)
251 251
252static void destroy_inodecache(void) 252static void destroy_inodecache(void)
253{ 253{
254 if (kmem_cache_destroy(adfs_inode_cachep)) 254 kmem_cache_destroy(adfs_inode_cachep);
255 printk(KERN_INFO "adfs_inode_cache: not all structures were freed\n");
256} 255}
257 256
258static struct super_operations adfs_sops = { 257static struct super_operations adfs_sops = {
diff --git a/fs/affs/super.c b/fs/affs/super.c
index b35f514479bf..5ea72c3a16c3 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -109,8 +109,7 @@ static int init_inodecache(void)
109 109
110static void destroy_inodecache(void) 110static void destroy_inodecache(void)
111{ 111{
112 if (kmem_cache_destroy(affs_inode_cachep)) 112 kmem_cache_destroy(affs_inode_cachep);
113 printk(KERN_INFO "affs_inode_cache: not all structures were freed\n");
114} 113}
115 114
116static struct super_operations affs_sops = { 115static struct super_operations affs_sops = {
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 50cfca5c7efd..f6676fbe9484 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -446,9 +446,7 @@ befs_init_inodecache(void)
446static void 446static void
447befs_destroy_inodecache(void) 447befs_destroy_inodecache(void)
448{ 448{
449 if (kmem_cache_destroy(befs_inode_cachep)) 449 kmem_cache_destroy(befs_inode_cachep);
450 printk(KERN_ERR "befs_destroy_inodecache: "
451 "not all structures were freed\n");
452} 450}
453 451
454/* 452/*
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index 3e4d6c767b9b..8fc2e8e49dbe 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -268,8 +268,7 @@ static int init_inodecache(void)
268 268
269static void destroy_inodecache(void) 269static void destroy_inodecache(void)
270{ 270{
271 if (kmem_cache_destroy(bfs_inode_cachep)) 271 kmem_cache_destroy(bfs_inode_cachep);
272 printk(KERN_INFO "bfs_inode_cache: not all structures were freed\n");
273} 272}
274 273
275static struct super_operations bfs_sops = { 274static struct super_operations bfs_sops = {
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index c3ef1c0d0e68..4197a5043f13 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -699,8 +699,7 @@ cifs_init_inodecache(void)
699static void 699static void
700cifs_destroy_inodecache(void) 700cifs_destroy_inodecache(void)
701{ 701{
702 if (kmem_cache_destroy(cifs_inode_cachep)) 702 kmem_cache_destroy(cifs_inode_cachep);
703 printk(KERN_WARNING "cifs_inode_cache: error freeing\n");
704} 703}
705 704
706static int 705static int
@@ -778,13 +777,9 @@ static void
778cifs_destroy_request_bufs(void) 777cifs_destroy_request_bufs(void)
779{ 778{
780 mempool_destroy(cifs_req_poolp); 779 mempool_destroy(cifs_req_poolp);
781 if (kmem_cache_destroy(cifs_req_cachep)) 780 kmem_cache_destroy(cifs_req_cachep);
782 printk(KERN_WARNING
783 "cifs_destroy_request_cache: error not all structures were freed\n");
784 mempool_destroy(cifs_sm_req_poolp); 781 mempool_destroy(cifs_sm_req_poolp);
785 if (kmem_cache_destroy(cifs_sm_req_cachep)) 782 kmem_cache_destroy(cifs_sm_req_cachep);
786 printk(KERN_WARNING
787 "cifs_destroy_request_cache: cifs_small_rq free error\n");
788} 783}
789 784
790static int 785static int
@@ -819,13 +814,8 @@ static void
819cifs_destroy_mids(void) 814cifs_destroy_mids(void)
820{ 815{
821 mempool_destroy(cifs_mid_poolp); 816 mempool_destroy(cifs_mid_poolp);
822 if (kmem_cache_destroy(cifs_mid_cachep)) 817 kmem_cache_destroy(cifs_mid_cachep);
823 printk(KERN_WARNING 818 kmem_cache_destroy(cifs_oplock_cachep);
824 "cifs_destroy_mids: error not all structures were freed\n");
825
826 if (kmem_cache_destroy(cifs_oplock_cachep))
827 printk(KERN_WARNING
828 "error not all oplock structures were freed\n");
829} 819}
830 820
831static int cifs_oplock_thread(void * dummyarg) 821static int cifs_oplock_thread(void * dummyarg)
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 87f1dc8aa24b..88d123321164 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -80,8 +80,7 @@ int coda_init_inodecache(void)
80 80
81void coda_destroy_inodecache(void) 81void coda_destroy_inodecache(void)
82{ 82{
83 if (kmem_cache_destroy(coda_inode_cachep)) 83 kmem_cache_destroy(coda_inode_cachep);
84 printk(KERN_INFO "coda_inode_cache: not all structures were freed\n");
85} 84}
86 85
87static int coda_remount(struct super_block *sb, int *flags, char *data) 86static int coda_remount(struct super_block *sb, int *flags, char *data)
diff --git a/fs/efs/super.c b/fs/efs/super.c
index 7089269ee9ae..b3f50651eb6b 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -90,8 +90,7 @@ static int init_inodecache(void)
90 90
91static void destroy_inodecache(void) 91static void destroy_inodecache(void)
92{ 92{
93 if (kmem_cache_destroy(efs_inode_cachep)) 93 kmem_cache_destroy(efs_inode_cachep);
94 printk(KERN_INFO "efs_inode_cache: not all structures were freed\n");
95} 94}
96 95
97static void efs_put_super(struct super_block *s) 96static void efs_put_super(struct super_block *s)
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 69435fbe53f2..513cd421ac0b 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -184,8 +184,7 @@ static int init_inodecache(void)
184 184
185static void destroy_inodecache(void) 185static void destroy_inodecache(void)
186{ 186{
187 if (kmem_cache_destroy(ext2_inode_cachep)) 187 kmem_cache_destroy(ext2_inode_cachep);
188 printk(KERN_INFO "ext2_inode_cache: not all structures were freed\n");
189} 188}
190 189
191static void ext2_clear_inode(struct inode *inode) 190static void ext2_clear_inode(struct inode *inode)
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 09b4b313ca07..8bfd56ef18ca 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -491,8 +491,7 @@ static int init_inodecache(void)
491 491
492static void destroy_inodecache(void) 492static void destroy_inodecache(void)
493{ 493{
494 if (kmem_cache_destroy(ext3_inode_cachep)) 494 kmem_cache_destroy(ext3_inode_cachep);
495 printk(KERN_INFO "ext3_inode_cache: not all structures were freed\n");
496} 495}
497 496
498static void ext3_clear_inode(struct inode *inode) 497static void ext3_clear_inode(struct inode *inode)
diff --git a/fs/fat/cache.c b/fs/fat/cache.c
index 97b967b84fc6..82cc4f59e3ba 100644
--- a/fs/fat/cache.c
+++ b/fs/fat/cache.c
@@ -58,8 +58,7 @@ int __init fat_cache_init(void)
58 58
59void fat_cache_destroy(void) 59void fat_cache_destroy(void)
60{ 60{
61 if (kmem_cache_destroy(fat_cache_cachep)) 61 kmem_cache_destroy(fat_cache_cachep);
62 printk(KERN_INFO "fat_cache: not all structures were freed\n");
63} 62}
64 63
65static inline struct fat_cache *fat_cache_alloc(struct inode *inode) 64static inline struct fat_cache *fat_cache_alloc(struct inode *inode)
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index bc4da3a48c8c..d30151190434 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -528,8 +528,7 @@ static int __init fat_init_inodecache(void)
528 528
529static void __exit fat_destroy_inodecache(void) 529static void __exit fat_destroy_inodecache(void)
530{ 530{
531 if (kmem_cache_destroy(fat_inode_cachep)) 531 kmem_cache_destroy(fat_inode_cachep);
532 printk(KERN_INFO "fat_inode_cache: not all structures were freed\n");
533} 532}
534 533
535static int fat_remount(struct super_block *sb, int *flags, char *data) 534static int fat_remount(struct super_block *sb, int *flags, char *data)
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 05dffff1a372..d43b4fcc8ad3 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -454,8 +454,7 @@ static int __init init_hfs_fs(void)
454static void __exit exit_hfs_fs(void) 454static void __exit exit_hfs_fs(void)
455{ 455{
456 unregister_filesystem(&hfs_fs_type); 456 unregister_filesystem(&hfs_fs_type);
457 if (kmem_cache_destroy(hfs_inode_cachep)) 457 kmem_cache_destroy(hfs_inode_cachep);
458 printk(KERN_ERR "hfs_inode_cache: not all structures were freed\n");
459} 458}
460 459
461module_init(init_hfs_fs) 460module_init(init_hfs_fs)
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index d279d5924f28..194eede52fa4 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -493,8 +493,7 @@ static int __init init_hfsplus_fs(void)
493static void __exit exit_hfsplus_fs(void) 493static void __exit exit_hfsplus_fs(void)
494{ 494{
495 unregister_filesystem(&hfsplus_fs_type); 495 unregister_filesystem(&hfsplus_fs_type);
496 if (kmem_cache_destroy(hfsplus_inode_cachep)) 496 kmem_cache_destroy(hfsplus_inode_cachep);
497 printk(KERN_ERR "hfsplus_inode_cache: not all structures were freed\n");
498} 497}
499 498
500module_init(init_hfsplus_fs) 499module_init(init_hfsplus_fs)
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index b76d60832375..450b5e0b4785 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -203,8 +203,7 @@ static int init_inodecache(void)
203 203
204static void destroy_inodecache(void) 204static void destroy_inodecache(void)
205{ 205{
206 if (kmem_cache_destroy(hpfs_inode_cachep)) 206 kmem_cache_destroy(hpfs_inode_cachep);
207 printk(KERN_INFO "hpfs_inode_cache: not all structures were freed\n");
208} 207}
209 208
210/* 209/*
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index ab15e9072151..10e47897bac7 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -96,9 +96,7 @@ static int init_inodecache(void)
96 96
97static void destroy_inodecache(void) 97static void destroy_inodecache(void)
98{ 98{
99 if (kmem_cache_destroy(isofs_inode_cachep)) 99 kmem_cache_destroy(isofs_inode_cachep);
100 printk(KERN_INFO "iso_inode_cache: not all structures were "
101 "freed\n");
102} 100}
103 101
104static int isofs_remount(struct super_block *sb, int *flags, char *data) 102static int isofs_remount(struct super_block *sb, int *flags, char *data)
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index e24be7fc0651..826b9d830650 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -90,8 +90,7 @@ static int init_inodecache(void)
90 90
91static void destroy_inodecache(void) 91static void destroy_inodecache(void)
92{ 92{
93 if (kmem_cache_destroy(minix_inode_cachep)) 93 kmem_cache_destroy(minix_inode_cachep);
94 printk(KERN_INFO "minix_inode_cache: not all structures were freed\n");
95} 94}
96 95
97static struct super_operations minix_sops = { 96static struct super_operations minix_sops = {
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 752f02e43ab0..8244710e97dd 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -81,8 +81,7 @@ static int init_inodecache(void)
81 81
82static void destroy_inodecache(void) 82static void destroy_inodecache(void)
83{ 83{
84 if (kmem_cache_destroy(ncp_inode_cachep)) 84 kmem_cache_destroy(ncp_inode_cachep);
85 printk(KERN_INFO "ncp_inode_cache: not all structures were freed\n");
86} 85}
87 86
88static int ncp_remount(struct super_block *sb, int *flags, char* data) 87static int ncp_remount(struct super_block *sb, int *flags, char* data)
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 76ca1cbc38f9..377839bed172 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -855,6 +855,5 @@ int __init nfs_init_directcache(void)
855 */ 855 */
856void nfs_destroy_directcache(void) 856void nfs_destroy_directcache(void)
857{ 857{
858 if (kmem_cache_destroy(nfs_direct_cachep)) 858 kmem_cache_destroy(nfs_direct_cachep);
859 printk(KERN_INFO "nfs_direct_cache: not all structures were freed\n");
860} 859}
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index a9d0f71eb5f7..931f52a19579 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1134,8 +1134,7 @@ static int __init nfs_init_inodecache(void)
1134 1134
1135static void nfs_destroy_inodecache(void) 1135static void nfs_destroy_inodecache(void)
1136{ 1136{
1137 if (kmem_cache_destroy(nfs_inode_cachep)) 1137 kmem_cache_destroy(nfs_inode_cachep);
1138 printk(KERN_INFO "nfs_inode_cache: not all structures were freed\n");
1139} 1138}
1140 1139
1141/* 1140/*
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 36e902a88ca1..829af323f288 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -392,7 +392,6 @@ int __init nfs_init_nfspagecache(void)
392 392
393void nfs_destroy_nfspagecache(void) 393void nfs_destroy_nfspagecache(void)
394{ 394{
395 if (kmem_cache_destroy(nfs_page_cachep)) 395 kmem_cache_destroy(nfs_page_cachep);
396 printk(KERN_INFO "nfs_page: not all structures were freed\n");
397} 396}
398 397
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 69f1549da2b9..c2e49c397a27 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -737,6 +737,5 @@ int __init nfs_init_readpagecache(void)
737void nfs_destroy_readpagecache(void) 737void nfs_destroy_readpagecache(void)
738{ 738{
739 mempool_destroy(nfs_rdata_mempool); 739 mempool_destroy(nfs_rdata_mempool);
740 if (kmem_cache_destroy(nfs_rdata_cachep)) 740 kmem_cache_destroy(nfs_rdata_cachep);
741 printk(KERN_INFO "nfs_read_data: not all structures were freed\n");
742} 741}
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index c12effb46fe5..b674462793d3 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1565,7 +1565,6 @@ void nfs_destroy_writepagecache(void)
1565{ 1565{
1566 mempool_destroy(nfs_commit_mempool); 1566 mempool_destroy(nfs_commit_mempool);
1567 mempool_destroy(nfs_wdata_mempool); 1567 mempool_destroy(nfs_wdata_mempool);
1568 if (kmem_cache_destroy(nfs_wdata_cachep)) 1568 kmem_cache_destroy(nfs_wdata_cachep);
1569 printk(KERN_INFO "nfs_write_data: not all structures were freed\n");
1570} 1569}
1571 1570
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 1a25c01ecdf1..ebcf226a9e4a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1005,13 +1005,10 @@ alloc_init_file(struct inode *ino)
1005static void 1005static void
1006nfsd4_free_slab(kmem_cache_t **slab) 1006nfsd4_free_slab(kmem_cache_t **slab)
1007{ 1007{
1008 int status;
1009
1010 if (*slab == NULL) 1008 if (*slab == NULL)
1011 return; 1009 return;
1012 status = kmem_cache_destroy(*slab); 1010 kmem_cache_destroy(*slab);
1013 *slab = NULL; 1011 *slab = NULL;
1014 WARN_ON(status);
1015} 1012}
1016 1013
1017static void 1014static void
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 74e0ee8fce72..6b2712f10dd2 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -3248,32 +3248,14 @@ ictx_err_out:
3248 3248
3249static void __exit exit_ntfs_fs(void) 3249static void __exit exit_ntfs_fs(void)
3250{ 3250{
3251 int err = 0;
3252
3253 ntfs_debug("Unregistering NTFS driver."); 3251 ntfs_debug("Unregistering NTFS driver.");
3254 3252
3255 unregister_filesystem(&ntfs_fs_type); 3253 unregister_filesystem(&ntfs_fs_type);
3256 3254 kmem_cache_destroy(ntfs_big_inode_cache);
3257 if (kmem_cache_destroy(ntfs_big_inode_cache) && (err = 1)) 3255 kmem_cache_destroy(ntfs_inode_cache);
3258 printk(KERN_CRIT "NTFS: Failed to destory %s.\n", 3256 kmem_cache_destroy(ntfs_name_cache);
3259 ntfs_big_inode_cache_name); 3257 kmem_cache_destroy(ntfs_attr_ctx_cache);
3260 if (kmem_cache_destroy(ntfs_inode_cache) && (err = 1)) 3258 kmem_cache_destroy(ntfs_index_ctx_cache);
3261 printk(KERN_CRIT "NTFS: Failed to destory %s.\n",
3262 ntfs_inode_cache_name);
3263 if (kmem_cache_destroy(ntfs_name_cache) && (err = 1))
3264 printk(KERN_CRIT "NTFS: Failed to destory %s.\n",
3265 ntfs_name_cache_name);
3266 if (kmem_cache_destroy(ntfs_attr_ctx_cache) && (err = 1))
3267 printk(KERN_CRIT "NTFS: Failed to destory %s.\n",
3268 ntfs_attr_ctx_cache_name);
3269 if (kmem_cache_destroy(ntfs_index_ctx_cache) && (err = 1))
3270 printk(KERN_CRIT "NTFS: Failed to destory %s.\n",
3271 ntfs_index_ctx_cache_name);
3272 if (err)
3273 printk(KERN_CRIT "NTFS: This causes memory to leak! There is "
3274 "probably a BUG in the driver! Please report "
3275 "you saw this message to "
3276 "linux-ntfs-dev@lists.sourceforge.net\n");
3277 /* Unregister the ntfs sysctls. */ 3259 /* Unregister the ntfs sysctls. */
3278 ntfs_sysctl(0); 3260 ntfs_sysctl(0);
3279} 3261}
diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c
index 033ad1701232..0ff0898a0b9c 100644
--- a/fs/ocfs2/dlm/dlmfs.c
+++ b/fs/ocfs2/dlm/dlmfs.c
@@ -629,9 +629,7 @@ static void __exit exit_dlmfs_fs(void)
629 flush_workqueue(user_dlm_worker); 629 flush_workqueue(user_dlm_worker);
630 destroy_workqueue(user_dlm_worker); 630 destroy_workqueue(user_dlm_worker);
631 631
632 if (kmem_cache_destroy(dlmfs_inode_cache)) 632 kmem_cache_destroy(dlmfs_inode_cache);
633 printk(KERN_INFO "dlmfs_inode_cache: not all structures "
634 "were freed\n");
635} 633}
636 634
637MODULE_AUTHOR("Oracle"); 635MODULE_AUTHOR("Oracle");
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index 8497609f5022..fddbd61c68d0 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -556,9 +556,7 @@ static int init_inodecache(void)
556 556
557static void destroy_inodecache(void) 557static void destroy_inodecache(void)
558{ 558{
559 if (kmem_cache_destroy(qnx4_inode_cachep)) 559 kmem_cache_destroy(qnx4_inode_cachep);
560 printk(KERN_INFO
561 "qnx4_inode_cache: not all structures were freed\n");
562} 560}
563 561
564static int qnx4_get_sb(struct file_system_type *fs_type, 562static int qnx4_get_sb(struct file_system_type *fs_type,
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 5567328f1041..1cd4d387f690 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -530,9 +530,7 @@ static int init_inodecache(void)
530 530
531static void destroy_inodecache(void) 531static void destroy_inodecache(void)
532{ 532{
533 if (kmem_cache_destroy(reiserfs_inode_cachep)) 533 kmem_cache_destroy(reiserfs_inode_cachep);
534 reiserfs_warning(NULL,
535 "reiserfs_inode_cache: not all structures were freed");
536} 534}
537 535
538/* we don't mark inodes dirty, we just log them */ 536/* we don't mark inodes dirty, we just log them */
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c
index 22eed61ebf69..ddcd9e1ef282 100644
--- a/fs/romfs/inode.c
+++ b/fs/romfs/inode.c
@@ -589,8 +589,7 @@ static int init_inodecache(void)
589 589
590static void destroy_inodecache(void) 590static void destroy_inodecache(void)
591{ 591{
592 if (kmem_cache_destroy(romfs_inode_cachep)) 592 kmem_cache_destroy(romfs_inode_cachep);
593 printk(KERN_INFO "romfs_inode_cache: not all structures were freed\n");
594} 593}
595 594
596static int romfs_remount(struct super_block *sb, int *flags, char *data) 595static int romfs_remount(struct super_block *sb, int *flags, char *data)
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index a1ed657c3c84..92cf60aa6121 100644
--- a/fs/smbfs/inode.c
+++ b/fs/smbfs/inode.c
@@ -89,8 +89,7 @@ static int init_inodecache(void)
89 89
90static void destroy_inodecache(void) 90static void destroy_inodecache(void)
91{ 91{
92 if (kmem_cache_destroy(smb_inode_cachep)) 92 kmem_cache_destroy(smb_inode_cachep);
93 printk(KERN_INFO "smb_inode_cache: not all structures were freed\n");
94} 93}
95 94
96static int smb_remount(struct super_block *sb, int *flags, char *data) 95static int smb_remount(struct super_block *sb, int *flags, char *data)
diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c
index c8e96195b96e..0fb74697abc4 100644
--- a/fs/smbfs/request.c
+++ b/fs/smbfs/request.c
@@ -49,8 +49,7 @@ int smb_init_request_cache(void)
49 49
50void smb_destroy_request_cache(void) 50void smb_destroy_request_cache(void)
51{ 51{
52 if (kmem_cache_destroy(req_cachep)) 52 kmem_cache_destroy(req_cachep);
53 printk(KERN_INFO "smb_destroy_request_cache: not all structures were freed\n");
54} 53}
55 54
56/* 55/*
diff --git a/fs/udf/super.c b/fs/udf/super.c
index fcce1a21a51b..5dd356cbbda6 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -156,8 +156,7 @@ static int init_inodecache(void)
156 156
157static void destroy_inodecache(void) 157static void destroy_inodecache(void)
158{ 158{
159 if (kmem_cache_destroy(udf_inode_cachep)) 159 kmem_cache_destroy(udf_inode_cachep);
160 printk(KERN_INFO "udf_inode_cache: not all structures were freed\n");
161} 160}
162 161
163/* Superblock operations */ 162/* Superblock operations */
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index ef910e784034..ec79e3091d1b 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1244,8 +1244,7 @@ static int init_inodecache(void)
1244 1244
1245static void destroy_inodecache(void) 1245static void destroy_inodecache(void)
1246{ 1246{
1247 if (kmem_cache_destroy(ufs_inode_cachep)) 1247 kmem_cache_destroy(ufs_inode_cachep);
1248 printk(KERN_INFO "ufs_inode_cache: not all structures were freed\n");
1249} 1248}
1250 1249
1251#ifdef CONFIG_QUOTA 1250#ifdef CONFIG_QUOTA
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
index 939bd84bc7ee..0e8293c5a32f 100644
--- a/fs/xfs/linux-2.6/kmem.h
+++ b/fs/xfs/linux-2.6/kmem.h
@@ -91,8 +91,8 @@ kmem_zone_free(kmem_zone_t *zone, void *ptr)
91static inline void 91static inline void
92kmem_zone_destroy(kmem_zone_t *zone) 92kmem_zone_destroy(kmem_zone_t *zone)
93{ 93{
94 if (zone && kmem_cache_destroy(zone)) 94 if (zone)
95 BUG(); 95 kmem_cache_destroy(zone);
96} 96}
97 97
98extern void *kmem_zone_alloc(kmem_zone_t *, unsigned int __nocast); 98extern void *kmem_zone_alloc(kmem_zone_t *, unsigned int __nocast);
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 02e6f6798972..f8381f0660b2 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1275,10 +1275,7 @@ out_filesystem:
1275out_sysctl: 1275out_sysctl:
1276 if (mq_sysctl_table) 1276 if (mq_sysctl_table)
1277 unregister_sysctl_table(mq_sysctl_table); 1277 unregister_sysctl_table(mq_sysctl_table);
1278 if (kmem_cache_destroy(mqueue_inode_cachep)) { 1278 kmem_cache_destroy(mqueue_inode_cachep);
1279 printk(KERN_INFO
1280 "mqueue_inode_cache: not all structures were freed\n");
1281 }
1282 return error; 1279 return error;
1283} 1280}
1284 1281
diff --git a/mm/shmem.c b/mm/shmem.c
index 8631be45b40d..0a8e29cf87e0 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2157,8 +2157,7 @@ static int init_inodecache(void)
2157 2157
2158static void destroy_inodecache(void) 2158static void destroy_inodecache(void)
2159{ 2159{
2160 if (kmem_cache_destroy(shmem_inode_cachep)) 2160 kmem_cache_destroy(shmem_inode_cachep);
2161 printk(KERN_INFO "shmem_inode_cache: not all structures were freed\n");
2162} 2161}
2163 2162
2164static const struct address_space_operations shmem_aops = { 2163static const struct address_space_operations shmem_aops = {
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index dfa504fe383f..f65bea74734d 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -858,7 +858,6 @@ int register_rpc_pipefs(void)
858 858
859void unregister_rpc_pipefs(void) 859void unregister_rpc_pipefs(void)
860{ 860{
861 if (kmem_cache_destroy(rpc_inode_cachep)) 861 kmem_cache_destroy(rpc_inode_cachep);
862 printk(KERN_WARNING "RPC: unable to free inode cache\n");
863 unregister_filesystem(&rpc_pipe_fs_type); 862 unregister_filesystem(&rpc_pipe_fs_type);
864} 863}
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 6390461a9756..a1ab4eed41f4 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -1059,10 +1059,10 @@ rpc_destroy_mempool(void)
1059 mempool_destroy(rpc_buffer_mempool); 1059 mempool_destroy(rpc_buffer_mempool);
1060 if (rpc_task_mempool) 1060 if (rpc_task_mempool)
1061 mempool_destroy(rpc_task_mempool); 1061 mempool_destroy(rpc_task_mempool);
1062 if (rpc_task_slabp && kmem_cache_destroy(rpc_task_slabp)) 1062 if (rpc_task_slabp)
1063 printk(KERN_INFO "rpc_task: not all structures were freed\n"); 1063 kmem_cache_destroy(rpc_task_slabp);
1064 if (rpc_buffer_slabp && kmem_cache_destroy(rpc_buffer_slabp)) 1064 if (rpc_buffer_slabp)
1065 printk(KERN_INFO "rpc_buffers: not all structures were freed\n"); 1065 kmem_cache_destroy(rpc_buffer_slabp);
1066} 1066}
1067 1067
1068int 1068int