From: Alexey Lyashkov Date: Mon, 19 Nov 2012 10:53:00 +0000 (+0400) Subject: LU-2370 ldiskfs: fix procfs access to mb groups. X-Git-Tag: 2.3.57~20 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d0da26d807a483083528bc99ef6f8b350476d474 LU-2370 ldiskfs: fix procfs access to mb groups. backporting a fix 95599968d19db175829fb580baa6b68939b320fb from kernel.org with additional memory allocation error handling. Xyratex-bug-id: MRP-757 Change-Id: I33e7daa18c8b74e34bbd1e12120e27ab7be23cf5 Signed-off-by: Alexey Lyashkov Reviewed-on: http://review.whamcloud.com/4654 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- diff --git a/ldiskfs/kernel_patches/patches/ext4-fix-mbgroups-access.patch b/ldiskfs/kernel_patches/patches/ext4-fix-mbgroups-access.patch new file mode 100644 index 0000000..e6fc5e2 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext4-fix-mbgroups-access.patch @@ -0,0 +1,34 @@ +Index: linux-stage/fs/ext4/mballoc.c +=================================================================== +--- linux-stage.orig/fs/ext4/mballoc.c 2012-11-21 11:22:19.000000000 +0200 ++++ linux-stage/fs/ext4/mballoc.c 2012-11-21 11:24:33.000000000 +0200 +@@ -2622,6 +2622,9 @@ int ext4_mb_release(struct super_block * + struct ext4_group_info *grinfo; + struct ext4_sb_info *sbi = EXT4_SB(sb); + ++ if (sbi->s_proc) ++ remove_proc_entry("mb_groups", sbi->s_proc); ++ + if (sbi->s_group_info) { + for (i = 0; i < ngroups; i++) { + grinfo = ext4_get_group_info(sb, i); +@@ -2673,7 +2676,6 @@ int ext4_mb_release(struct super_block * + + free_percpu(sbi->s_locality_groups); + if (sbi->s_proc) { +- remove_proc_entry("mb_groups", sbi->s_proc); + remove_proc_entry(EXT4_MB_PREALLOC_TABLE, sbi->s_proc); + } + +@@ -4801,6 +4803,11 @@ do_more: + * be used until this transaction is committed + */ + new_entry = kmem_cache_alloc(ext4_free_data_cachep, GFP_NOFS); ++ if (!new_entry) { ++ ext4_mb_release_desc(&e4b); ++ err = -ENOMEM; ++ goto error_return; ++ } + new_entry->efd_start_blk = bit; + new_entry->efd_group = block_group; + new_entry->efd_count = count; diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series index 1d90c78..261528a 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series @@ -38,3 +38,4 @@ ext4-quota-force-block-alloc-quotaoff.patch ext4-quota-dont-update-cmtime.patch ext4-quota-first-class.patch ext4-inode_info_reorganize.patch +ext4-fix-mbgroups-access.patch