From 6cb20b041e19763b5515184e873f64e012280647 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 17 Jun 2011 14:01:44 -0600 Subject: [PATCH 1/1] LU-228 kernel: remove more unused kernel patches The filterdata patches have been unused and unnecessary for some time already. The jbd-slab-race and include-fixes patches were merged into the upstream kernel and back-ported into RHEL5. Change-Id: I01851a60ecf453f6eb5dbfc4f573444f4f220861 Signed-off-by: Andreas Dilger Reviewed-on: http://review.whamcloud.com/962 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin --- .../patches/ext3-filterdata-sles10.patch | 25 ----- .../patches/ext4-filterdata-rhel5.patch | 25 ----- .../patches/ext4-filterdata-sles11.patch | 25 ----- .../patches/ext4-include-fixes-2.6-rhel5.patch | 20 ---- lustre/kernel_patches/patches/i_filter_data.patch | 16 ---- .../patches/jbd-slab-race-2.6-rhel5.patch | 101 --------------------- 6 files changed, 212 deletions(-) delete mode 100644 ldiskfs/kernel_patches/patches/ext3-filterdata-sles10.patch delete mode 100644 ldiskfs/kernel_patches/patches/ext4-filterdata-rhel5.patch delete mode 100644 ldiskfs/kernel_patches/patches/ext4-filterdata-sles11.patch delete mode 100644 ldiskfs/kernel_patches/patches/ext4-include-fixes-2.6-rhel5.patch delete mode 100644 lustre/kernel_patches/patches/i_filter_data.patch delete mode 100644 lustre/kernel_patches/patches/jbd-slab-race-2.6-rhel5.patch diff --git a/ldiskfs/kernel_patches/patches/ext3-filterdata-sles10.patch b/ldiskfs/kernel_patches/patches/ext3-filterdata-sles10.patch deleted file mode 100644 index 5f7c8c9..0000000 --- a/ldiskfs/kernel_patches/patches/ext3-filterdata-sles10.patch +++ /dev/null @@ -1,25 +0,0 @@ -Index: linux-2.6.16.27-0.9-full/include/linux/ext3_fs_i.h -=================================================================== ---- linux-2.6.16.27-0.9-full.orig/include/linux/ext3_fs_i.h 2007-03-28 16:03:20.000000000 +0400 -+++ linux-2.6.16.27-0.9-full/include/linux/ext3_fs_i.h 2007-03-28 19:40:53.000000000 +0400 -@@ -139,6 +139,8 @@ struct ext3_inode_info { - /* mballoc */ - struct list_head i_prealloc_list; - spinlock_t i_prealloc_lock; -+ -+ void *i_filterdata; - }; - - #endif /* _LINUX_EXT3_FS_I */ -Index: linux-2.6.16.27-0.9-full/fs/ext3/super.c -=================================================================== ---- linux-2.6.16.27-0.9-full.orig/fs/ext3/super.c 2007-03-28 18:20:17.000000000 +0400 -+++ linux-2.6.16.27-0.9-full/fs/ext3/super.c 2007-03-28 19:40:53.000000000 +0400 -@@ -462,6 +462,7 @@ static struct inode *ext3_alloc_inode(st - memset(&ei->i_cached_extent, 0, sizeof(ei->i_cached_extent)); - INIT_LIST_HEAD(&ei->i_prealloc_list); - spin_lock_init(&ei->i_prealloc_lock); -+ ei->i_filterdata = NULL; - return &ei->vfs_inode; - } - diff --git a/ldiskfs/kernel_patches/patches/ext4-filterdata-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-filterdata-rhel5.patch deleted file mode 100644 index 2bb1d36..0000000 --- a/ldiskfs/kernel_patches/patches/ext4-filterdata-rhel5.patch +++ /dev/null @@ -1,25 +0,0 @@ -Index: linux-2.6.18.i386/fs/ext4/ext4_i.h -=================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/ext4_i.h -+++ linux-2.6.18.i386/fs/ext4/ext4_i.h -@@ -162,6 +162,8 @@ struct ext4_inode_info { - __u16 i_extra_isize; - - spinlock_t i_block_reservation_lock; -+ -+ void *i_filterdata; - }; - - #endif /* _EXT4_I */ -Index: linux-2.6.18.i386/fs/ext4/super.c -=================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/super.c -+++ linux-2.6.18.i386/fs/ext4/super.c -@@ -574,6 +574,7 @@ static struct inode *ext4_alloc_inode(st - ei->i_allocated_meta_blocks = 0; - ei->i_delalloc_reserved_flag = 0; - spin_lock_init(&(ei->i_block_reservation_lock)); -+ ei->i_filterdata = NULL; - return &ei->vfs_inode; - } - diff --git a/ldiskfs/kernel_patches/patches/ext4-filterdata-sles11.patch b/ldiskfs/kernel_patches/patches/ext4-filterdata-sles11.patch deleted file mode 100644 index ea83bcd..0000000 --- a/ldiskfs/kernel_patches/patches/ext4-filterdata-sles11.patch +++ /dev/null @@ -1,25 +0,0 @@ -Index: linux-2.6.27.21-0.1/fs/ext4/ext4_i.h -=================================================================== ---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_i.h -+++ linux-2.6.27.21-0.1/fs/ext4/ext4_i.h -@@ -135,6 +135,8 @@ struct ext4_inode_info { - __u16 i_extra_isize; - - spinlock_t i_block_reservation_lock; -+ -+ void *i_filterdata; - }; - - #endif /* _EXT4_I */ -Index: linux-2.6.27.21-0.1/fs/ext4/super.c -=================================================================== ---- linux-2.6.27.21-0.1.orig/fs/ext4/super.c -+++ linux-2.6.27.21-0.1/fs/ext4/super.c -@@ -624,6 +624,7 @@ static struct inode *ext4_alloc_inode(st - memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache)); - INIT_LIST_HEAD(&ei->i_prealloc_list); - spin_lock_init(&ei->i_prealloc_lock); -+ ei->i_filterdata = NULL; - jbd2_journal_init_jbd_inode(&ei->jinode, &ei->vfs_inode); - ei->i_reserved_data_blocks = 0; - ei->i_reserved_meta_blocks = 0; diff --git a/ldiskfs/kernel_patches/patches/ext4-include-fixes-2.6-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-include-fixes-2.6-rhel5.patch deleted file mode 100644 index 0009eaa..0000000 --- a/ldiskfs/kernel_patches/patches/ext4-include-fixes-2.6-rhel5.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: linux-2.6.18.i386/fs/ext4/ext4.h -=================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/ext4.h -+++ linux-2.6.18.i386/fs/ext4/ext4.h -@@ -541,12 +541,13 @@ do { \ - #define EXT4_MOUNT_IOPEN 0x8000000 /* Allow access via iopen */ - #define EXT4_MOUNT_IOPEN_NOPRIV 0x10000000 /* Make iopen world-readable */ - /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */ --#ifndef _LINUX_EXT2_FS_H -+#ifndef clear_opt - #define clear_opt(o, opt) o &= ~EXT4_MOUNT_##opt - #define set_opt(o, opt) o |= EXT4_MOUNT_##opt - #define test_opt(sb, opt) (EXT4_SB(sb)->s_mount_opt & \ - EXT4_MOUNT_##opt) --#else -+#endif -+#ifndef EXT2_MOUNT_NOLOAD - #define EXT2_MOUNT_NOLOAD EXT4_MOUNT_NOLOAD - #define EXT2_MOUNT_ABORT EXT4_MOUNT_ABORT - #define EXT2_MOUNT_DATA_FLAGS EXT4_MOUNT_DATA_FLAGS diff --git a/lustre/kernel_patches/patches/i_filter_data.patch b/lustre/kernel_patches/patches/i_filter_data.patch deleted file mode 100644 index cac3f9b..0000000 --- a/lustre/kernel_patches/patches/i_filter_data.patch +++ /dev/null @@ -1,16 +0,0 @@ -The i_filterdata is currently only used by the size-on-mds to store the -epoch number for the inode. This could be moved to another field in -ldiskfs or elsewhere in the inode that isn't used by Lustre callers. - -Index: linux-2.6.18-128.1.6/include/linux/fs.h -=================================================================== ---- linux-2.6.18-128.1.6.orig/include/linux/fs.h 2009-04-14 21:05:43.000000000 -0600 -+++ linux-2.6.18-128.1.6/include/linux/fs.h 2009-06-02 23:21:44.000000000 -0600 -@@ -580,6 +580,7 @@ - struct cdev *i_cdev; - }; - int i_cindex; -+ void *i_filterdata; - - __u32 i_generation; - diff --git a/lustre/kernel_patches/patches/jbd-slab-race-2.6-rhel5.patch b/lustre/kernel_patches/patches/jbd-slab-race-2.6-rhel5.patch deleted file mode 100644 index 0a11f74..0000000 --- a/lustre/kernel_patches/patches/jbd-slab-race-2.6-rhel5.patch +++ /dev/null @@ -1,101 +0,0 @@ -kmem_cache_create: duplicate cache jbd_4k - -The jbd slab cache creation/deletion is racey. If multiple jbd based -filesystems are mounted concurrently, and there are no other jbd based -filesystems already mounted. Then we can race creating the slab caches -since jbd_slab[] is not locked. This is not commonly observed because -typically /root is mounted early with a jbd based filesystem making the -race impossible. On our diskless systems /root does not use the jbd -but we do have attached storage which does, and which is mounted in -parallel. Basically our setup is similiar to what may be found in a -NAS style appliance. - -This patch wraps all modifications to jbd_slab[] in the jbd_slab_lock -to prevent this above race. - -LLNL Bug 291 -Signed-off-by: Brian Behlendorf - -Index: linux+rh+chaos/fs/jbd/journal.c -=================================================================== ---- linux+rh+chaos.orig/fs/jbd/journal.c -+++ linux+rh+chaos/fs/jbd/journal.c -@@ -1979,6 +1979,7 @@ void * __jbd_kmalloc (const char *where, - #define JBD_MAX_SLABS 5 - #define JBD_SLAB_INDEX(size) (size >> 11) - -+static DECLARE_RWSEM(jbd_slab_lock); /* protect jbd_slab[] */ - static kmem_cache_t *jbd_slab[JBD_MAX_SLABS]; - static const char *jbd_slab_names[JBD_MAX_SLABS] = { - "jbd_1k", "jbd_2k", "jbd_4k", NULL, "jbd_8k" -@@ -1988,24 +1989,27 @@ static void journal_destroy_jbd_slabs(vo - { - int i; - -+ down_write(&jbd_slab_lock); - for (i = 0; i < JBD_MAX_SLABS; i++) { - if (jbd_slab[i]) - kmem_cache_destroy(jbd_slab[i]); - jbd_slab[i] = NULL; - } -+ up_write(&jbd_slab_lock); - } - - static int journal_create_jbd_slab(size_t slab_size) - { -- int i = JBD_SLAB_INDEX(slab_size); -+ int rc = 0, i = JBD_SLAB_INDEX(slab_size); - - BUG_ON(i >= JBD_MAX_SLABS); - - /* - * Check if we already have a slab created for this size - */ -+ down_write(&jbd_slab_lock); - if (jbd_slab[i]) -- return 0; -+ goto out_lock; - - /* - * Create a slab and force alignment to be same as slabsize - -@@ -2016,27 +2020,36 @@ static int journal_create_jbd_slab(size_ - slab_size, slab_size, 0, NULL, NULL); - if (!jbd_slab[i]) { - printk(KERN_EMERG "JBD: no memory for jbd_slab cache\n"); -- return -ENOMEM; -+ rc = -ENOMEM; - } -- return 0; -+out_lock: -+ up_write(&jbd_slab_lock); -+ return rc; - } - - void * jbd_slab_alloc(size_t size, gfp_t flags) - { -+ void *ptr; - int idx; - -+ down_read(&jbd_slab_lock); - idx = JBD_SLAB_INDEX(size); - BUG_ON(jbd_slab[idx] == NULL); -- return kmem_cache_alloc(jbd_slab[idx], flags | __GFP_NOFAIL); -+ ptr = kmem_cache_alloc(jbd_slab[idx], flags | __GFP_NOFAIL); -+ up_read(&jbd_slab_lock); -+ -+ return ptr; - } - - void jbd_slab_free(void *ptr, size_t size) - { - int idx; - -+ down_read(&jbd_slab_lock); - idx = JBD_SLAB_INDEX(size); - BUG_ON(jbd_slab[idx] == NULL); - kmem_cache_free(jbd_slab[idx], ptr); -+ up_read(&jbd_slab_lock); - } - - /* - -- 1.8.3.1