All of lore.kernel.org
 help / color / mirror / Atom feed
* slab allocators: Remove SLAB_DEBUG_INITIAL flag
@ 2007-04-21  1:39 Christoph Lameter
  2007-04-23  6:08 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Lameter @ 2007-04-21  1:39 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

I have never seen a use of SLAB_DEBUG_INITIAL. It is only supported by SLAB.

I think its purpose was to have a callback after an object has been freed
to verify that the state is the constructor state again? The callback is
performed before each freeing of an object.

I would think that it is much easier to check the object state manually
before the free. That also places the check near the code object
manipulation of the object.

Also the SLAB_DEBUG_INITIAL callback is only performed if the kernel was 
compiled with SLAB debugging on. If there would be code in a constructor 
handling SLAB_DEBUG_INITIAL then it would have to be conditional on 
SLAB_DEBUG otherwise it would just be dead code. But there is no such code 
in the kernel. I think SLUB_DEBUG_INITIAL is too problematic to make real 
use of, difficult to understand and there are easier ways to accomplish 
the same effect (i.e. add debug code before kfree).

There is a related flag SLAB_CTOR_VERIFY that is frequently checked
to be clear in fs inode caches. Remove the pointless checks 
(they would even be pointless without removeal of SLAB_DEBUG_INITIAL) 
from the fs constructors.

This is the last slab flag that SLUB did not support. Remove the check
for unimplemented flags from SLUB.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.21-rc6/include/linux/slab.h
===================================================================
--- linux-2.6.21-rc6.orig/include/linux/slab.h	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/include/linux/slab.h	2007-04-20 18:08:22.000000000 -0700
@@ -21,7 +21,6 @@ typedef struct kmem_cache kmem_cache_t _
  * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set.
  */
 #define SLAB_DEBUG_FREE		0x00000100UL	/* DEBUG: Perform (expensive) checks on free */
-#define SLAB_DEBUG_INITIAL	0x00000200UL	/* DEBUG: Call constructor (as verifier) */
 #define SLAB_RED_ZONE		0x00000400UL	/* DEBUG: Red zone objs in a cache */
 #define SLAB_POISON		0x00000800UL	/* DEBUG: Poison objects */
 #define SLAB_HWCACHE_ALIGN	0x00002000UL	/* Align objs on cache lines */
@@ -36,7 +35,6 @@ typedef struct kmem_cache kmem_cache_t _
 /* Flags passed to a constructor functions */
 #define SLAB_CTOR_CONSTRUCTOR	0x001UL		/* If not set, then deconstructor */
 #define SLAB_CTOR_ATOMIC	0x002UL		/* Tell constructor it can't sleep */
-#define SLAB_CTOR_VERIFY	0x004UL		/* Tell constructor it's a verify call */
 
 /*
  * struct kmem_cache related prototypes
Index: linux-2.6.21-rc6/mm/slab.c
===================================================================
--- linux-2.6.21-rc6.orig/mm/slab.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/mm/slab.c	2007-04-20 18:08:22.000000000 -0700
@@ -116,8 +116,7 @@
 #include	<asm/page.h>
 
 /*
- * DEBUG	- 1 for kmem_cache_create() to honour; SLAB_DEBUG_INITIAL,
- *		  SLAB_RED_ZONE & SLAB_POISON.
+ * DEBUG	- 1 for kmem_cache_create() to honour; SLAB_RED_ZONE & SLAB_POISON.
  *		  0 for faster, smaller code (especially in the critical paths).
  *
  * STATS	- 1 to collect stats for /proc/slabinfo.
@@ -172,7 +171,7 @@
 
 /* Legal flag mask for kmem_cache_create(). */
 #if DEBUG
-# define CREATE_MASK	(SLAB_DEBUG_INITIAL | SLAB_RED_ZONE | \
+# define CREATE_MASK	(SLAB_RED_ZONE | \
 			 SLAB_POISON | SLAB_HWCACHE_ALIGN | \
 			 SLAB_CACHE_DMA | \
 			 SLAB_STORE_USER | \
@@ -2182,12 +2181,6 @@ kmem_cache_create (const char *name, siz
 
 #if DEBUG
 	WARN_ON(strchr(name, ' '));	/* It confuses parsers */
-	if ((flags & SLAB_DEBUG_INITIAL) && !ctor) {
-		/* No constructor, but inital state check requested */
-		printk(KERN_ERR "%s: No con, but init state check "
-		       "requested - %s\n", __FUNCTION__, name);
-		flags &= ~SLAB_DEBUG_INITIAL;
-	}
 #if FORCED_DEBUG
 	/*
 	 * Enable redzoning and last user accounting, except for caches with
@@ -2892,15 +2885,6 @@ static void *cache_free_debugcheck(struc
 	BUG_ON(objnr >= cachep->num);
 	BUG_ON(objp != index_to_obj(cachep, slabp, objnr));
 
-	if (cachep->flags & SLAB_DEBUG_INITIAL) {
-		/*
-		 * Need to call the slab's constructor so the caller can
-		 * perform a verify of its state (debugging).  Called without
-		 * the cache-lock held.
-		 */
-		cachep->ctor(objp + obj_offset(cachep),
-			     cachep, SLAB_CTOR_CONSTRUCTOR | SLAB_CTOR_VERIFY);
-	}
 	if (cachep->flags & SLAB_POISON && cachep->dtor) {
 		/* we want to cache poison the object,
 		 * call the destruction callback
Index: linux-2.6.21-rc6/drivers/mtd/ubi/eba.c
===================================================================
--- linux-2.6.21-rc6.orig/drivers/mtd/ubi/eba.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/drivers/mtd/ubi/eba.c	2007-04-20 18:08:22.000000000 -0700
@@ -940,8 +940,7 @@ static void ltree_entry_ctor(void *obj, 
 {
 	struct ltree_entry *le = obj;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) !=
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		return;
 
 	le->users = 0;
Index: linux-2.6.21-rc6/fs/block_dev.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/block_dev.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/block_dev.c	2007-04-20 18:08:22.000000000 -0700
@@ -455,9 +455,7 @@ static void init_once(void * foo, struct
 	struct bdev_inode *ei = (struct bdev_inode *) foo;
 	struct block_device *bdev = &ei->bdev;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
-	{
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		memset(bdev, 0, sizeof(*bdev));
 		mutex_init(&bdev->bd_mutex);
 		sema_init(&bdev->bd_mount_sem, 1);
Index: linux-2.6.21-rc6/fs/buffer.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/buffer.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/buffer.c	2007-04-20 18:08:22.000000000 -0700
@@ -2961,8 +2961,7 @@ EXPORT_SYMBOL(free_buffer_head);
 static void
 init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags)
 {
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-			    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		struct buffer_head * bh = (struct buffer_head *)data;
 
 		memset(bh, 0, sizeof(*bh));
Index: linux-2.6.21-rc6/fs/cifs/cifsfs.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/cifs/cifsfs.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/cifs/cifsfs.c	2007-04-20 18:08:22.000000000 -0700
@@ -693,8 +693,7 @@ cifs_init_once(void *inode, struct kmem_
 {
 	struct cifsInodeInfo *cifsi = inode;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		inode_init_once(&cifsi->vfs_inode);
 		INIT_LIST_HEAD(&cifsi->lockList);
 	}
Index: linux-2.6.21-rc6/fs/ext2/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ext2/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ext2/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -161,8 +161,7 @@ static void init_once(void * foo, struct
 {
 	struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		rwlock_init(&ei->i_meta_lock);
 #ifdef CONFIG_EXT2_FS_XATTR
 		init_rwsem(&ei->xattr_sem);
Index: linux-2.6.21-rc6/fs/ext3/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ext3/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ext3/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -466,8 +466,7 @@ static void init_once(void * foo, struct
 {
 	struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		INIT_LIST_HEAD(&ei->i_orphan);
 #ifdef CONFIG_EXT3_FS_XATTR
 		init_rwsem(&ei->xattr_sem);
Index: linux-2.6.21-rc6/fs/fuse/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/fuse/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/fuse/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -685,8 +685,7 @@ static void fuse_inode_init_once(void *f
 {
 	struct inode * inode = foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(inode);
 }
 
Index: linux-2.6.21-rc6/fs/gfs2/main.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/gfs2/main.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/gfs2/main.c	2007-04-20 18:08:22.000000000 -0700
@@ -27,8 +27,7 @@
 static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
 	struct gfs2_inode *ip = foo;
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		inode_init_once(&ip->i_inode);
 		spin_lock_init(&ip->i_spin);
 		init_rwsem(&ip->i_rw_mutex);
@@ -39,8 +38,7 @@ static void gfs2_init_inode_once(void *f
 static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
 {
 	struct gfs2_glock *gl = foo;
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		INIT_HLIST_NODE(&gl->gl_list);
 		spin_lock_init(&gl->gl_spin);
 		INIT_LIST_HEAD(&gl->gl_holders);
Index: linux-2.6.21-rc6/fs/hugetlbfs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/hugetlbfs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/hugetlbfs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -549,8 +549,7 @@ static void init_once(void *foo, struct 
 {
 	struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/fs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -213,8 +213,7 @@ static void init_once(void * foo, struct
 {
 	struct inode * inode = (struct inode *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(inode);
 }
 
Index: linux-2.6.21-rc6/fs/jffs2/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/jffs2/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/jffs2/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -49,8 +49,7 @@ static void jffs2_i_init_once(void * foo
 {
 	struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		init_MUTEX(&ei->sem);
 		inode_init_once(&ei->vfs_inode);
 	}
Index: linux-2.6.21-rc6/fs/nfs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/nfs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/nfs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -1162,8 +1162,7 @@ static void init_once(void * foo, struct
 {
 	struct nfs_inode *nfsi = (struct nfs_inode *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		inode_init_once(&nfsi->vfs_inode);
 		spin_lock_init(&nfsi->req_lock);
 		INIT_LIST_HEAD(&nfsi->dirty);
Index: linux-2.6.21-rc6/fs/ntfs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ntfs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ntfs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -3085,8 +3085,7 @@ static void ntfs_big_inode_init_once(voi
 {
 	ntfs_inode *ni = (ntfs_inode *)foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-			SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(VFS_I(ni));
 }
 
Index: linux-2.6.21-rc6/fs/ocfs2/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ocfs2/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ocfs2/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -937,8 +937,7 @@ static void ocfs2_inode_init_once(void *
 {
 	struct ocfs2_inode_info *oi = data;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		oi->ip_flags = 0;
 		oi->ip_open_count = 0;
 		spin_lock_init(&oi->ip_lock);
Index: linux-2.6.21-rc6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/reiserfs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/reiserfs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -512,8 +512,7 @@ static void init_once(void *foo, struct 
 {
 	struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		INIT_LIST_HEAD(&ei->i_prealloc_list);
 		inode_init_once(&ei->vfs_inode);
 #ifdef CONFIG_REISERFS_FS_POSIX_ACL
Index: linux-2.6.21-rc6/fs/romfs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/romfs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/romfs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -594,8 +594,7 @@ static void romfs_i_init_once(void *_ino
 {
 	struct romfs_inode_info *inode = _inode;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&inode->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/fs/unionfs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/unionfs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/unionfs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -209,8 +209,7 @@ static void init_once(void *v, struct km
 {
 	struct unionfs_inode_info *i = v;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&i->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/kernel/fork.c
===================================================================
--- linux-2.6.21-rc6.orig/kernel/fork.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/kernel/fork.c	2007-04-20 18:08:22.000000000 -0700
@@ -1426,8 +1426,7 @@ static void sighand_ctor(void *data, str
 {
 	struct sighand_struct *sighand = data;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
-					SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		spin_lock_init(&sighand->siglock);
 }
 
Index: linux-2.6.21-rc6/mm/rmap.c
===================================================================
--- linux-2.6.21-rc6.orig/mm/rmap.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/mm/rmap.c	2007-04-20 18:08:22.000000000 -0700
@@ -162,8 +162,7 @@ void anon_vma_unlink(struct vm_area_stru
 static void anon_vma_ctor(void *data, struct kmem_cache *cachep,
 			  unsigned long flags)
 {
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-						SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		struct anon_vma *anon_vma = data;
 
 		spin_lock_init(&anon_vma->lock);
Index: linux-2.6.21-rc6/mm/shmem.c
===================================================================
--- linux-2.6.21-rc6.orig/mm/shmem.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/mm/shmem.c	2007-04-20 18:08:22.000000000 -0700
@@ -2329,8 +2329,7 @@ static void init_once(void *foo, struct 
 {
 	struct shmem_inode_info *p = (struct shmem_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		inode_init_once(&p->vfs_inode);
 #ifdef CONFIG_TMPFS_POSIX_ACL
 		p->i_acl = NULL;
Index: linux-2.6.21-rc6/net/socket.c
===================================================================
--- linux-2.6.21-rc6.orig/net/socket.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/net/socket.c	2007-04-20 18:08:22.000000000 -0700
@@ -261,8 +261,7 @@ static void init_once(void *foo, struct 
 {
 	struct socket_alloc *ei = (struct socket_alloc *)foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR))
-	    == SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/arch/powerpc/platforms/cell/spufs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/arch/powerpc/platforms/cell/spufs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/arch/powerpc/platforms/cell/spufs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -69,8 +69,7 @@ spufs_init_once(void *p, struct kmem_cac
 {
 	struct spufs_inode_info *ei = p;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		inode_init_once(&ei->vfs_inode);
 	}
 }
Index: linux-2.6.21-rc6/fs/adfs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/adfs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/adfs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -232,8 +232,7 @@ static void init_once(void * foo, struct
 {
 	struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
  
Index: linux-2.6.21-rc6/fs/affs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/affs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/affs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -87,8 +87,7 @@ static void init_once(void * foo, struct
 {
 	struct affs_inode_info *ei = (struct affs_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		init_MUTEX(&ei->i_link_lock);
 		init_MUTEX(&ei->i_ext_lock);
 		inode_init_once(&ei->vfs_inode);
Index: linux-2.6.21-rc6/fs/afs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/afs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/afs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -387,8 +387,7 @@ static void afs_i_init_once(void *_vnode
 {
 	struct afs_vnode *vnode = (struct afs_vnode *) _vnode;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		memset(vnode, 0, sizeof(*vnode));
 		inode_init_once(&vnode->vfs_inode);
 		init_waitqueue_head(&vnode->update_waitq);
Index: linux-2.6.21-rc6/fs/befs/linuxvfs.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/befs/linuxvfs.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/befs/linuxvfs.c	2007-04-20 18:08:22.000000000 -0700
@@ -293,8 +293,7 @@ static void init_once(void * foo, struct
 {
         struct befs_inode_info *bi = (struct befs_inode_info *) foo;
 	
-	        if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-		            SLAB_CTOR_CONSTRUCTOR) {
+	        if (flags & SLAB_CTOR_CONSTRUCTOR) {
 			inode_init_once(&bi->vfs_inode);
 		}
 }
Index: linux-2.6.21-rc6/fs/bfs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/bfs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/bfs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -248,8 +248,7 @@ static void init_once(void * foo, struct
 {
 	struct bfs_inode_info *bi = foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&bi->vfs_inode);
 }
  
Index: linux-2.6.21-rc6/fs/coda/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/coda/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/coda/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -62,8 +62,7 @@ static void init_once(void * foo, struct
 {
 	struct coda_inode_info *ei = (struct coda_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
  
Index: linux-2.6.21-rc6/fs/ecryptfs/main.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ecryptfs/main.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ecryptfs/main.c	2007-04-20 18:08:22.000000000 -0700
@@ -583,8 +583,7 @@ inode_info_init_once(void *vptr, struct 
 {
 	struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/fs/efs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/efs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/efs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -72,8 +72,7 @@ static void init_once(void * foo, struct
 {
 	struct efs_inode_info *ei = (struct efs_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
  
Index: linux-2.6.21-rc6/fs/ext4/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ext4/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ext4/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -517,8 +517,7 @@ static void init_once(void * foo, struct
 {
 	struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		INIT_LIST_HEAD(&ei->i_orphan);
 #ifdef CONFIG_EXT4DEV_FS_XATTR
 		init_rwsem(&ei->xattr_sem);
Index: linux-2.6.21-rc6/fs/fat/cache.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/fat/cache.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/fat/cache.c	2007-04-20 18:08:22.000000000 -0700
@@ -40,8 +40,7 @@ static void init_once(void *foo, struct 
 {
 	struct fat_cache *cache = (struct fat_cache *)foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		INIT_LIST_HEAD(&cache->cache_list);
 }
 
Index: linux-2.6.21-rc6/fs/fat/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/fat/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/fat/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -499,8 +499,7 @@ static void init_once(void * foo, struct
 {
 	struct msdos_inode_info *ei = (struct msdos_inode_info *)foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		spin_lock_init(&ei->cache_lru_lock);
 		ei->nr_caches = 0;
 		ei->cache_valid_id = FAT_CACHE_VALID + 1;
Index: linux-2.6.21-rc6/fs/hfs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/hfs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/hfs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -434,7 +434,7 @@ static void hfs_init_once(void *p, struc
 {
 	struct hfs_inode_info *i = p;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&i->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/fs/hfsplus/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/hfsplus/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/hfsplus/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -470,7 +470,7 @@ static void hfsplus_init_once(void *p, s
 {
 	struct hfsplus_inode_info *i = p;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&i->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/fs/hpfs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/hpfs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/hpfs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -176,8 +176,7 @@ static void init_once(void * foo, struct
 {
 	struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		mutex_init(&ei->i_mutex);
 		mutex_init(&ei->i_parent_mutex);
 		inode_init_once(&ei->vfs_inode);
Index: linux-2.6.21-rc6/fs/isofs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/isofs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/isofs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -77,8 +77,7 @@ static void init_once(void *foo, struct 
 {
 	struct iso_inode_info *ei = foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
  
Index: linux-2.6.21-rc6/fs/jfs/jfs_metapage.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/jfs/jfs_metapage.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/jfs/jfs_metapage.c	2007-04-20 18:08:22.000000000 -0700
@@ -184,8 +184,7 @@ static void init_once(void *foo, struct 
 {
 	struct metapage *mp = (struct metapage *)foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		mp->lid = 0;
 		mp->lsn = 0;
 		mp->flag = 0;
Index: linux-2.6.21-rc6/fs/jfs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/jfs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/jfs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -752,8 +752,7 @@ static void init_once(void *foo, struct 
 {
 	struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
 		INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
 		init_rwsem(&jfs_ip->rdwrlock);
Index: linux-2.6.21-rc6/fs/locks.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/locks.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/locks.c	2007-04-20 18:08:22.000000000 -0700
@@ -203,8 +203,7 @@ static void init_once(void *foo, struct 
 {
 	struct file_lock *lock = (struct file_lock *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) !=
-					SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		return;
 
 	locks_init_lock(lock);
Index: linux-2.6.21-rc6/fs/minix/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/minix/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/minix/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -73,8 +73,7 @@ static void init_once(void * foo, struct
 {
 	struct minix_inode_info *ei = (struct minix_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
  
Index: linux-2.6.21-rc6/fs/ncpfs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ncpfs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ncpfs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -60,8 +60,7 @@ static void init_once(void * foo, struct
 {
 	struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		mutex_init(&ei->open_mutex);
 		inode_init_once(&ei->vfs_inode);
 	}
Index: linux-2.6.21-rc6/fs/ocfs2/dlm/dlmfs.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ocfs2/dlm/dlmfs.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ocfs2/dlm/dlmfs.c	2007-04-20 18:08:22.000000000 -0700
@@ -263,8 +263,7 @@ static void dlmfs_init_once(void *foo,
 	struct dlmfs_inode_private *ip =
 		(struct dlmfs_inode_private *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		ip->ip_dlm = NULL;
 		ip->ip_parent = NULL;
 
Index: linux-2.6.21-rc6/fs/openpromfs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/openpromfs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/openpromfs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -419,8 +419,7 @@ static void op_inode_init_once(void *dat
 {
 	struct op_inode_info *oi = (struct op_inode_info *) data;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&oi->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/fs/qnx4/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/qnx4/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/qnx4/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -536,8 +536,7 @@ static void init_once(void *foo, struct 
 {
 	struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/fs/smbfs/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/smbfs/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/smbfs/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -69,9 +69,8 @@ static void smb_destroy_inode(struct ino
 static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
 {
 	struct smb_inode_info *ei = (struct smb_inode_info *) foo;
-	unsigned long flagmask = SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR;
 
-	if ((flags & flagmask) == SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
  
Index: linux-2.6.21-rc6/fs/sysv/inode.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/sysv/inode.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/sysv/inode.c	2007-04-20 18:08:22.000000000 -0700
@@ -322,8 +322,7 @@ static void init_once(void *p, struct km
 {
 	struct sysv_inode_info *si = (struct sysv_inode_info *)p;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-			SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&si->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/fs/udf/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/udf/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/udf/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -134,9 +134,7 @@ static void init_once(void * foo, struct
 {
 	struct udf_inode_info *ei = (struct udf_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
-	{
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		ei->i_ext.i_data = NULL;
 		inode_init_once(&ei->vfs_inode);
 	}
Index: linux-2.6.21-rc6/fs/ufs/super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/ufs/super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/ufs/super.c	2007-04-20 18:08:22.000000000 -0700
@@ -1237,8 +1237,7 @@ static void init_once(void * foo, struct
 {
 	struct ufs_inode_info *ei = (struct ufs_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
 }
  
Index: linux-2.6.21-rc6/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/xfs/linux-2.6/xfs_super.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/fs/xfs/linux-2.6/xfs_super.c	2007-04-20 18:08:22.000000000 -0700
@@ -360,8 +360,7 @@ xfs_fs_inode_init_once(
 	kmem_zone_t		*zonep,
 	unsigned long		flags)
 {
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-		      SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
 }
 
Index: linux-2.6.21-rc6/ipc/mqueue.c
===================================================================
--- linux-2.6.21-rc6.orig/ipc/mqueue.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/ipc/mqueue.c	2007-04-20 18:08:22.000000000 -0700
@@ -215,8 +215,7 @@ static void init_once(void *foo, struct 
 {
 	struct mqueue_inode_info *p = (struct mqueue_inode_info *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
-		SLAB_CTOR_CONSTRUCTOR)
+	if (flags & SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&p->vfs_inode);
 }
 
Index: linux-2.6.21-rc6/net/sunrpc/rpc_pipe.c
===================================================================
--- linux-2.6.21-rc6.orig/net/sunrpc/rpc_pipe.c	2007-04-20 18:07:16.000000000 -0700
+++ linux-2.6.21-rc6/net/sunrpc/rpc_pipe.c	2007-04-20 18:08:22.000000000 -0700
@@ -828,8 +828,7 @@ init_once(void * foo, struct kmem_cache 
 {
 	struct rpc_inode *rpci = (struct rpc_inode *) foo;
 
-	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-	    SLAB_CTOR_CONSTRUCTOR) {
+	if (flags & SLAB_CTOR_CONSTRUCTOR) {
 		inode_init_once(&rpci->vfs_inode);
 		rpci->private = NULL;
 		rpci->nreaders = 0;
Index: linux-2.6.21-rc6/mm/slub.c
===================================================================
--- linux-2.6.21-rc6.orig/mm/slub.c	2007-04-20 18:16:07.000000000 -0700
+++ linux-2.6.21-rc6/mm/slub.c	2007-04-20 18:16:48.000000000 -0700
@@ -103,20 +103,12 @@
  *
  * - Support PAGE_ALLOC_DEBUG. Should be easy to do.
  *
- * - SLAB_DEBUG_INITIAL is not supported but I have never seen a use of
- *   it.
- *
  * - Variable sizing of the per node arrays
  */
 
 /* Enable to test recovery from slab corruption on boot */
 #undef SLUB_RESILIENCY_TEST
 
-/*
- * Flags from the regular SLAB that SLUB does not support:
- */
-#define SLUB_UNIMPLEMENTED (SLAB_DEBUG_INITIAL)
-
 #define DEBUG_DEFAULT_FLAGS (SLAB_DEBUG_FREE | SLAB_RED_ZONE | \
 				SLAB_POISON | SLAB_STORE_USER)
 /*
@@ -1757,8 +1749,6 @@ static int kmem_cache_open(struct kmem_c
 	s->flags = flags;
 	s->align = align;
 
-	BUG_ON(flags & SLUB_UNIMPLEMENTED);
-
 	/*
 	 * The page->offset field is only 16 bit wide. This is an offset
 	 * in units of words from the beginning of an object. If the slab

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: slab allocators: Remove SLAB_DEBUG_INITIAL flag
  2007-04-21  1:39 slab allocators: Remove SLAB_DEBUG_INITIAL flag Christoph Lameter
@ 2007-04-23  6:08 ` Andrew Morton
  2007-04-23  6:20   ` Christoph Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-04-23  6:08 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-kernel

On Fri, 20 Apr 2007 18:39:43 -0700 (PDT) Christoph Lameter <clameter@sgi.com> wrote:

> I have never seen a use of SLAB_DEBUG_INITIAL. It is only supported by SLAB.
> 
> I think its purpose was to have a callback after an object has been freed
> to verify that the state is the constructor state again? The callback is
> performed before each freeing of an object.
> 
> I would think that it is much easier to check the object state manually
> before the free. That also places the check near the code object
> manipulation of the object.
> 
> Also the SLAB_DEBUG_INITIAL callback is only performed if the kernel was 
> compiled with SLAB debugging on. If there would be code in a constructor 
> handling SLAB_DEBUG_INITIAL then it would have to be conditional on 
> SLAB_DEBUG otherwise it would just be dead code. But there is no such code 
> in the kernel. I think SLUB_DEBUG_INITIAL is too problematic to make real 
> use of, difficult to understand and there are easier ways to accomplish 
> the same effect (i.e. add debug code before kfree).
> 
> There is a related flag SLAB_CTOR_VERIFY that is frequently checked
> to be clear in fs inode caches. Remove the pointless checks 
> (they would even be pointless without removeal of SLAB_DEBUG_INITIAL) 
> from the fs constructors.
> 
> This is the last slab flag that SLUB did not support. Remove the check
> for unimplemented flags from SLUB.

This patch causes a use-uninitialised crash in the locks code.



VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 316k freed
Write protecting the kernel read-only data: 961k
BUG: unable to handle kernel paging request at virtual address 5a5a5a66
 printing eip:
c0188f40
*pde = 00000000
Oops: 0000 [#1]
SMP 
Modules linked in:
CPU:    0
EIP:    0060:[<c0188f40>]    Not tainted VLI
EFLAGS: 00010206   (2.6.21-rc7-mm1 #17)
EIP is at locks_release_private+0x10/0x40
eax: 5a5a5a5a   ebx: c336f7cc   ecx: 00000000   edx: c336f850
esi: c336f850   edi: c336f850   ebp: c242fe40   esp: c242fe38
ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Process init (pid: 1, ti=c242e000 task=c242d550 task.ti=c242e000)
Stack: c336f850 c336f7cc c242fe50 c0189026 00000000 c3cfee2c c242fed0 c018a2fe 
       ffffffff c336f84c c242fe80 c0175b37 00000000 c3cfed24 c336f850 c242fe80 
       c01759f1 01003180 c336f7cc c336f748 00000000 000000d0 00000000 c013d825 
Call Trace:
 [<c0103e6a>] show_trace_log_lvl+0x1a/0x30
 [<c0103f29>] show_stack_log_lvl+0xa9/0xd0
 [<c0104139>] show_registers+0x1e9/0x2f0
 [<c0104355>] die+0x115/0x250
 [<c0116679>] do_page_fault+0x2d9/0x610
 [<c03e07b1>] error_code+0x79/0x80
 [<c0189026>] locks_copy_lock+0x16/0x50
 [<c018a2fe>] __posix_lock_file_conf+0x24e/0x530
 [<c018a613>] posix_lock_file+0x13/0x20
 [<c018bd49>] fcntl_setlk+0x129/0x260
 [<c0186a0a>] do_fcntl+0x2a/0x2a0
 [<c0186cbc>] sys_fcntl64+0x3c/0x80
 [<c0102dde>] sysenter_past_esp+0x5f/0x99
 =======================
Code: 4b fe ff ff 8d b4 26 00 00 00 00 8b 45 f0 e8 68 fd ff ff e9 4b ff ff ff 90 90 90 55 89 e5 53 89 c3 83 ec 04 8b 40 60 85 c0 74 12 <8b> 50 0c 85 d2 74 04 89 d8 ff d2 c7 43 60 00 00 00 00 8b 43 64 
EIP: [<c0188f40>] locks_release_private+0x10/0x40 SS:ESP 0068:c242fe38
Kernel panic - not syncing: Attempted to kill init!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: slab allocators: Remove SLAB_DEBUG_INITIAL flag
  2007-04-23  6:08 ` Andrew Morton
@ 2007-04-23  6:20   ` Christoph Lameter
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Lameter @ 2007-04-23  6:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On Sun, 22 Apr 2007, Andrew Morton wrote:

> This patch causes a use-uninitialised crash in the locks code.

Sigh. The only case in which the check is inverted in a constructor.

Invert the check.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.21-rc6/fs/locks.c
===================================================================
--- linux-2.6.21-rc6.orig/fs/locks.c	2007-04-22 23:17:29.000000000 -0700
+++ linux-2.6.21-rc6/fs/locks.c	2007-04-22 23:17:45.000000000 -0700
@@ -203,7 +203,7 @@ static void init_once(void *foo, struct 
 {
 	struct file_lock *lock = (struct file_lock *) foo;
 
-	if (flags & SLAB_CTOR_CONSTRUCTOR)
+	if (!(flags & SLAB_CTOR_CONSTRUCTOR))
 		return;
 
 	locks_init_lock(lock);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-23  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-21  1:39 slab allocators: Remove SLAB_DEBUG_INITIAL flag Christoph Lameter
2007-04-23  6:08 ` Andrew Morton
2007-04-23  6:20   ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.