Whamcloud - gitweb
LU-2762 ldiskfs: use upstream ext4_kvzalloc 81/5281/5
authorJames Simmons <uja.ornl@gmail.com>
Fri, 14 Jun 2013 14:27:13 +0000 (10:27 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 17 Aug 2013 05:39:16 +0000 (05:39 +0000)
Upstream commits f18a5f21 (v3.1) and 9933fc0a (v3.1) added and used
kvzalloc in the same matter the previous ldiskfs patches did.
We should use that instead of the open-coded versions.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Iad7771169d83c8aca3051198b1cfdb18030f0482
Reviewed-on: http://review.whamcloud.com/5281
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
ldiskfs/kernel_patches/patches/rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel6.3/ext4-vmalloc.patch [deleted file]
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series

diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch
new file mode 100644 (file)
index 0000000..622c3dd
--- /dev/null
@@ -0,0 +1,28 @@
+From c49bafa3842751b8955a962859f42d307673d75d Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <error27@gmail.com>
+Date: Sat, 30 Jul 2011 12:58:41 -0400
+Subject: ext4: add missing kfree() on error return path in add_new_gdb()
+Git-commit: c49bafa3
+Patch-mainline: v3.1-rc1
+
+We added some more error handling in b40971426a "ext4: add error
+checking to calls to ext4_handle_dirty_metadata()".  But we need to
+call kfree() as well to avoid a memory leak.
+
+Signed-off-by: Dan Carpenter <error27@gmail.com>
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Acked-by: Jeff Mahoney <jeffm@suse.com>
+---
+ fs/ext4/resize.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/fs/ext4/resize.c
++++ b/fs/ext4/resize.c
+@@ -475,6 +475,7 @@ static int add_new_gdb(handle_t *handle,
+       return 0;
+
+ exit_inode:
++      kfree(n_group_desc);
+       /* ext4_journal_release_buffer(handle, iloc.bh); */
+       brelse(iloc.bh);
+ exit_dindj:
diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch
new file mode 100644 (file)
index 0000000..290b514
--- /dev/null
@@ -0,0 +1,115 @@
+From 9933fc0ac1ac14b795819cd63d05ea92112f690a Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Mon, 1 Aug 2011 08:45:02 -0400
+Subject: ext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree()
+Git-commit: 9933fc0a
+Patch-mainline: v3.1-rc1
+
+Introduce new helper functions which try kmalloc, and then fall back
+to vmalloc if necessary, and use them for allocating and deallocating
+s_flex_groups.
+
+Upstream-Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+---
+ fs/ext4/ext4.h  |    3 +++
+ fs/ext4/super.c |   54 ++++++++++++++++++++++++++++++++++++------------------
+ 2 files changed, 39 insertions(+), 18 deletions(-)
+
+--- a/fs/ext4/ext4.h
++++ b/fs/ext4/ext4.h
+@@ -1686,6 +1686,9 @@ extern int ext4_group_extend(struct supe
+                               ext4_fsblk_t n_blocks_count);
+
+ /* super.c */
++extern void *ext4_kvmalloc(size_t size, gfp_t flags);
++extern void *ext4_kvzalloc(size_t size, gfp_t flags);
++extern void ext4_kvfree(void *ptr);
+ extern void __ext4_error(struct super_block *, const char *, const char *, ...)
+       __attribute__ ((format (printf, 3, 4)));
+ #define ext4_error(sb, message...)    __ext4_error(sb, __func__, ## message)
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -80,6 +80,35 @@ static void ext4_clear_request_list(void
+
+ wait_queue_head_t aio_wq[WQ_HASH_SZ];
+
++void *ext4_kvmalloc(size_t size, gfp_t flags)
++{
++      void *ret;
++
++      ret = kmalloc(size, flags);
++      if (!ret)
++              ret = __vmalloc(size, flags, PAGE_KERNEL);
++      return ret;
++}
++
++void *ext4_kvzalloc(size_t size, gfp_t flags)
++{
++      void *ret;
++
++      ret = kmalloc(size, flags);
++      if (!ret)
++              ret = __vmalloc(size, flags | __GFP_ZERO, PAGE_KERNEL);
++      return ret;
++}
++
++void ext4_kvfree(void *ptr)
++{
++      if (is_vmalloc_addr(ptr))
++              vfree(ptr);
++      else
++              kfree(ptr);
++
++}
++
+ ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
+                              struct ext4_group_desc *bg)
+ {
+@@ -677,10 +706,7 @@ static void ext4_put_super(struct super_
+       for (i = 0; i < sbi->s_gdb_count; i++)
+               brelse(sbi->s_group_desc[i]);
+       kfree(sbi->s_group_desc);
+-      if (is_vmalloc_addr(sbi->s_flex_groups))
+-              vfree(sbi->s_flex_groups);
+-      else
+-              kfree(sbi->s_flex_groups);
++      ext4_kvfree(sbi->s_flex_groups);
+       percpu_counter_destroy(&sbi->s_freeblocks_counter);
+       percpu_counter_destroy(&sbi->s_freeinodes_counter);
+       percpu_counter_destroy(&sbi->s_dirs_counter);
+@@ -1815,15 +1841,11 @@ static int ext4_fill_flex_info(struct su
+                       ((le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) + 1) <<
+                             EXT4_DESC_PER_BLOCK_BITS(sb))) / groups_per_flex;
+       size = flex_group_count * sizeof(struct flex_groups);
+-      sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
++      sbi->s_flex_groups = ext4_kvzalloc(size, GFP_KERNEL);
+       if (sbi->s_flex_groups == NULL) {
+-              sbi->s_flex_groups = vzalloc(size);
+-              if (sbi->s_flex_groups == NULL) {
+-                      ext4_msg(sb, KERN_ERR,
+-                               "not enough memory for %u flex groups",
+-                               flex_group_count);
+-                      goto failed;
+-              }
++              ext4_msg(sb, KERN_ERR, "not enough memory for %u flex groups",
++                       flex_group_count);
++              goto failed;
+       }
+
+       for (i = 0; i < sbi->s_groups_count; i++) {
+@@ -3464,12 +3486,8 @@ failed_mount_wq:
+               sbi->s_journal = NULL;
+       }
+ failed_mount3:
+-      if (sbi->s_flex_groups) {
+-              if (is_vmalloc_addr(sbi->s_flex_groups))
+-                      vfree(sbi->s_flex_groups);
+-              else
+-                      kfree(sbi->s_flex_groups);
+-      }
++      if (sbi->s_flex_groups)
++              ext4_kvfree(sbi->s_flex_groups);
+       percpu_counter_destroy(&sbi->s_freeblocks_counter);
+       percpu_counter_destroy(&sbi->s_freeinodes_counter);
+       percpu_counter_destroy(&sbi->s_dirs_counter);
diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch
new file mode 100644 (file)
index 0000000..8a68794
--- /dev/null
@@ -0,0 +1,114 @@
+From f18a5f21c25707b4fe64b326e2b4d150565e7300 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Mon, 1 Aug 2011 08:45:38 -0400
+Subject: ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info
+Git-commit: f18a5f21
+Patch-mainline: v3.1-rc1
+
+Upstream-Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+---
+ fs/ext4/mballoc.c |    6 +++---
+ fs/ext4/resize.c  |   13 +++++++------
+ fs/ext4/super.c   |    9 +++++----
+ 3 files changed, 15 insertions(+), 13 deletions(-)
+
+--- a/fs/ext4/mballoc.c
++++ b/fs/ext4/mballoc.c
+@@ -2307,7 +2307,7 @@ static int ext4_mb_init_backend(struct s
+       /* An 8TB filesystem with 64-bit pointers requires a 4096 byte
+        * kmalloc. A 128kb malloc should suffice for a 256TB filesystem.
+        * So a two level scheme suffices for now. */
+-      sbi->s_group_info = kmalloc(array_size, GFP_KERNEL);
++      sbi->s_group_info = ext4_kvzalloc(array_size, GFP_KERNEL);
+       if (sbi->s_group_info == NULL) {
+               printk(KERN_ERR "EXT4-fs: can't allocate buddy meta group\n");
+               return -ENOMEM;
+@@ -2339,7 +2339,7 @@ err_freebuddy:
+               kfree(sbi->s_group_info[i]);
+       iput(sbi->s_buddy_cache);
+ err_freesgi:
+-      kfree(sbi->s_group_info);
++      ext4_kvfree(sbi->s_group_info);
+       return -ENOMEM;
+ }
+
+@@ -2464,7 +2464,7 @@ int ext4_mb_release(struct super_block *
+                       EXT4_DESC_PER_BLOCK_BITS(sb);
+               for (i = 0; i < num_meta_group_infos; i++)
+                       kfree(sbi->s_group_info[i]);
+-              kfree(sbi->s_group_info);
++              ext4_kvfree(sbi->s_group_info);
+       }
+       kfree(sbi->s_mb_offsets);
+       kfree(sbi->s_mb_maxs);
+--- a/fs/ext4/resize.c
++++ b/fs/ext4/resize.c
+@@ -435,12 +435,13 @@ static int add_new_gdb(handle_t *handle,
+       if ((err = ext4_reserve_inode_write(handle, inode, &iloc)))
+               goto exit_dindj;
+
+-      n_group_desc = kmalloc((gdb_num + 1) * sizeof(struct buffer_head *),
+-                      GFP_NOFS);
++      n_group_desc = ext4_kvmalloc((gdb_num + 1) *
++                                   sizeof(struct buffer_head *),
++                                   GFP_NOFS);
+       if (!n_group_desc) {
+               err = -ENOMEM;
+-              ext4_warning(sb,
+-                            "not enough memory for %lu groups", gdb_num + 1);
++              ext4_warning(sb, "not enough memory for %lu groups",
++                           gdb_num + 1);
+               goto exit_inode;
+       }
+
+@@ -467,7 +468,7 @@ static int add_new_gdb(handle_t *handle,
+       n_group_desc[gdb_num] = *primary;
+       EXT4_SB(sb)->s_group_desc = n_group_desc;
+       EXT4_SB(sb)->s_gdb_count++;
+-      kfree(o_group_desc);
++      ext4_kvfree(o_group_desc);
+
+       le16_add_cpu(&es->s_reserved_gdt_blocks, -1);
+       ext4_handle_dirty_metadata(handle, NULL, EXT4_SB(sb)->s_sbh);
+@@ -475,7 +476,7 @@ static int add_new_gdb(handle_t *handle,
+       return 0;
+
+ exit_inode:
+-      kfree(n_group_desc);
++      ext4_kvfree(n_group_desc);
+       /* ext4_journal_release_buffer(handle, iloc.bh); */
+       brelse(iloc.bh);
+ exit_dindj:
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -705,7 +705,7 @@ static void ext4_put_super(struct super_
+
+       for (i = 0; i < sbi->s_gdb_count; i++)
+               brelse(sbi->s_group_desc[i]);
+-      kfree(sbi->s_group_desc);
++      ext4_kvfree(sbi->s_group_desc);
+       ext4_kvfree(sbi->s_flex_groups);
+       percpu_counter_destroy(&sbi->s_freeblocks_counter);
+       percpu_counter_destroy(&sbi->s_freeinodes_counter);
+@@ -3169,8 +3169,9 @@ static int ext4_fill_super(struct super_
+                       (EXT4_MAX_BLOCK_FILE_PHYS / EXT4_BLOCKS_PER_GROUP(sb)));
+       db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) /
+                  EXT4_DESC_PER_BLOCK(sb);
+-      sbi->s_group_desc = kmalloc(db_count * sizeof(struct buffer_head *),
+-                                  GFP_KERNEL);
++      sbi->s_group_desc = ext4_kvmalloc(db_count *
++                                        sizeof(struct buffer_head *),
++                                        GFP_KERNEL);
+       if (sbi->s_group_desc == NULL) {
+               ext4_msg(sb, KERN_ERR, "not enough memory");
+               goto failed_mount;
+@@ -3495,7 +3496,7 @@ failed_mount3:
+ failed_mount2:
+       for (i = 0; i < db_count; i++)
+               brelse(sbi->s_group_desc[i]);
+-      kfree(sbi->s_group_desc);
++      ext4_kvfree(sbi->s_group_desc);
+ failed_mount:
+       if (sbi->s_proc) {
+               remove_proc_entry(sb->s_id, ext4_proc_root);
diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch
new file mode 100644 (file)
index 0000000..764f8dd
--- /dev/null
@@ -0,0 +1,38 @@
+From 94de56ab2062be59d80e2efb7c0dc60ecf616075 Mon Sep 17 00:00:00 2001
+From: Joe Perches <joe@perches.com>
+Date: Sun, 19 Dec 2010 22:21:02 -0500
+Subject: ext4: Use vzalloc in ext4_fill_flex_info()
+Git-commit: 94de56ab
+Patch-mainline: v2.6.38-rc1
+
+Signed-off-by: Joe Perches <joe@perches.com>
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Acked-by: Jeff Mahoney <jeffm@suse.com>
+---
+ fs/ext4/super.c |   15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -1817,14 +1817,13 @@ static int ext4_fill_flex_info(struct su
+       size = flex_group_count * sizeof(struct flex_groups);
+       sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
+       if (sbi->s_flex_groups == NULL) {
+-              sbi->s_flex_groups = vmalloc(size);
+-              if (sbi->s_flex_groups)
+-                      memset(sbi->s_flex_groups, 0, size);
+-      }
+-      if (sbi->s_flex_groups == NULL) {
+-              ext4_msg(sb, KERN_ERR, "not enough memory for "
+-                              "%u flex groups", flex_group_count);
+-              goto failed;
++              sbi->s_flex_groups = vzalloc(size);
++              if (sbi->s_flex_groups == NULL) {
++                      ext4_msg(sb, KERN_ERR,
++                               "not enough memory for %u flex groups",
++                               flex_group_count);
++                      goto failed;
++              }
+       }
+
+       for (i = 0; i < sbi->s_groups_count; i++) {
diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-vmalloc.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-vmalloc.patch
deleted file mode 100644 (file)
index 359bee0..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-Index: linux-stage/fs/ext4/super.c
-===================================================================
---- linux-stage.orig/fs/ext4/super.c
-+++ linux-stage/fs/ext4/super.c
-@@ -675,7 +675,12 @@ static void ext4_put_super(struct super_
-       for (i = 0; i < sbi->s_gdb_count; i++)
-               brelse(sbi->s_group_desc[i]);
--      kfree(sbi->s_group_desc);
-+
-+      if (is_vmalloc_addr(sbi->s_group_desc))
-+              vfree(sbi->s_group_desc);
-+      else
-+              kfree(sbi->s_group_desc);
-+
-       if (is_vmalloc_addr(sbi->s_flex_groups))
-               vfree(sbi->s_flex_groups);
-       else
-@@ -2519,12 +2524,13 @@ static int ext4_fill_super(struct super_
-       unsigned long offset = 0;
-       unsigned long journal_devnum = 0;
-       unsigned long def_mount_opts;
--      struct inode *root;
-+      struct inode *root = NULL;
-       char *cp;
-       const char *descr;
-       int ret = -EINVAL;
-       int blocksize;
-       unsigned int db_count;
-+      size_t size;
-       unsigned int i;
-       int needs_recovery, has_huge_files;
-       __u64 blocks_count;
-@@ -2850,11 +2856,18 @@ static int ext4_fill_super(struct super_
-                       (EXT4_MAX_BLOCK_FILE_PHYS / EXT4_BLOCKS_PER_GROUP(sb)));
-       db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) /
-                  EXT4_DESC_PER_BLOCK(sb);
--      sbi->s_group_desc = kmalloc(db_count * sizeof(struct buffer_head *),
--                                  GFP_KERNEL);
-+      size = (size_t)db_count * sizeof(struct buffer_head *);
-+      sbi->s_group_desc = kzalloc(size, GFP_KERNEL);
-       if (sbi->s_group_desc == NULL) {
--              ext4_msg(sb, KERN_ERR, "not enough memory");
--              goto failed_mount;
-+              sbi->s_group_desc = vmalloc(size);
-+              if (sbi->s_group_desc != NULL) {
-+                      memset(sbi->s_group_desc, 0, size);
-+              } else {
-+                      ext4_msg(sb, KERN_ERR, "no memory for %u groups (%u)\n",
-+                               sbi->s_groups_count, (unsigned int)size);
-+                      ret = -ENOMEM;
-+                      goto failed_mount;
-+              }
-       }
- #ifdef __BIG_ENDIAN
-@@ -3064,17 +3077,16 @@ no_journal:
-       if (IS_ERR(root)) {
-               ext4_msg(sb, KERN_ERR, "get root inode failed");
-               ret = PTR_ERR(root);
-+              root = NULL;
-               goto failed_mount4;
-       }
-       if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) {
--              iput(root);
-               ext4_msg(sb, KERN_ERR, "corrupt root inode, run e2fsck");
-               goto failed_mount4;
-       }
-       sb->s_root = d_alloc_root(root);
-       if (!sb->s_root) {
-               ext4_msg(sb, KERN_ERR, "get root dentry failed");
--              iput(root);
-               ret = -ENOMEM;
-               goto failed_mount4;
-       }
-@@ -3125,6 +3137,7 @@ no_journal:
-       if (err) {
-               ext4_msg(sb, KERN_ERR, "failed to initalize mballoc (%d)",
-                        err);
-+              ret = err;
-               goto failed_mount4;
-       }
-@@ -3166,6 +3179,8 @@ cantfind_ext4:
-       goto failed_mount;
- failed_mount4:
-+      iput(root);
-+      sb->s_root = NULL;
-       ext4_msg(sb, KERN_ERR, "mount failed");
-       destroy_workqueue(EXT4_SB(sb)->dio_unwritten_wq);
- failed_mount_wq:
-@@ -3190,7 +3205,11 @@ failed_mount3:
- failed_mount2:
-       for (i = 0; i < db_count; i++)
-               brelse(sbi->s_group_desc[i]);
--      kfree(sbi->s_group_desc);
-+
-+      if (is_vmalloc_addr(sbi->s_group_desc))
-+              vfree(sbi->s_group_desc);
-+      else
-+              kfree(sbi->s_group_desc);
- failed_mount:
-       if (sbi->s_proc) {
-               remove_proc_entry(sb->s_id, ext4_proc_root);
-Index: linux-stage/fs/ext4/mballoc.c
-===================================================================
---- linux-stage.orig/fs/ext4/mballoc.c
-+++ linux-stage/fs/ext4/mballoc.c
-@@ -23,6 +23,7 @@
- #include "mballoc.h"
- #include <linux/debugfs.h>
-+#include <linux/vmalloc.h>
- #include <trace/events/ext4.h>
- /*
-@@ -2408,24 +2409,37 @@ static int ext4_mb_init_backend(struct s
-       while (array_size < sizeof(*sbi->s_group_info) *
-              num_meta_group_infos_max)
-               array_size = array_size << 1;
--      /* An 8TB filesystem with 64-bit pointers requires a 4096 byte
--       * kmalloc. A 128kb malloc should suffice for a 256TB filesystem.
--       * So a two level scheme suffices for now. */
--      sbi->s_group_info = kmalloc(array_size, GFP_KERNEL);
-+      /* A 16TB filesystem with 64-bit pointers requires an 8192 byte
-+       * kmalloc(). Filesystems larger than 2^32 blocks (16TB normally)
-+       * have group descriptors at least twice as large (64 bytes or
-+       * more vs. 32 bytes for traditional ext3 filesystems), so a 128TB
-+       * filesystem needs a 128kB allocation, which may need vmalloc(). */
-+      sbi->s_group_info = kzalloc(array_size, GFP_KERNEL);
-       if (sbi->s_group_info == NULL) {
--              printk(KERN_ERR "EXT4-fs: can't allocate buddy meta group\n");
--              return -ENOMEM;
-+              sbi->s_group_info = vmalloc(array_size);
-+              if (sbi->s_group_info != NULL) {
-+                      memset(sbi->s_group_info, 0, array_size);
-+              } else {
-+                      ext4_msg(sb, KERN_ERR, "no memory for groupinfo (%u)\n",
-+                               array_size);
-+                      return -ENOMEM;
-+              }
-       }
-       sbi->s_buddy_cache = new_inode(sb);
-       if (sbi->s_buddy_cache == NULL) {
--              printk(KERN_ERR "EXT4-fs: can't get new inode\n");
-+              ext4_msg(sb, KERN_ERR, "can't get new inode\n");
-               goto err_freesgi;
-       }
-+      /* To avoid potentially colliding with an valid on-disk inode number,
-+       * use EXT4_BAD_INO for the buddy cache inode number.  This inode is
-+       * not in the inode hash, so it should never be found by iget(), but
-+       * this will avoid confusion if it ever shows up during debugging. */
-+      sbi->s_buddy_cache->i_ino = EXT4_BAD_INO;
-       EXT4_I(sbi->s_buddy_cache)->i_disksize = 0;
-       for (i = 0; i < ngroups; i++) {
-               desc = ext4_get_group_desc(sb, i, NULL);
-               if (desc == NULL) {
--                      printk(KERN_ERR
-+                      ext4_msg(sb, KERN_ERR,
-                               "EXT4-fs: can't read descriptor %u\n", i);
-                       goto err_freebuddy;
-               }
-@@ -2461,7 +2474,10 @@ err_freebuddy:
-               kfree(sbi->s_group_info[i]);
-       iput(sbi->s_buddy_cache);
- err_freesgi:
--      kfree(sbi->s_group_info);
-+      if (is_vmalloc_addr(sbi->s_group_info))
-+              vfree(sbi->s_group_info);
-+      else
-+              kfree(sbi->s_group_info);
-       return -ENOMEM;
- }
-@@ -2639,7 +2647,10 @@ int ext4_mb_release(struct super_block *
-                       EXT4_DESC_PER_BLOCK_BITS(sb);
-               for (i = 0; i < num_meta_group_infos; i++)
-                       kfree(sbi->s_group_info[i]);
--              kfree(sbi->s_group_info);
-+              if (is_vmalloc_addr(sbi->s_group_info))
-+                      vfree(sbi->s_group_info);
-+              else
-+                      kfree(sbi->s_group_info);
-       }
-       kfree(sbi->s_mb_prealloc_table);
-       kfree(sbi->s_mb_offsets);
index 639c546..705d3c0 100644 (file)
@@ -1,3 +1,7 @@
+rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch
+rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch
+rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch
+rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch
 rhel6.3/ext4-wantedi-2.6.patch
 rhel6.3/ext4-map_inode_page-2.6.18.patch
 rhel6.3/export-ext4-2.6.patch
@@ -30,7 +34,6 @@ rhel6.3/ext4-large-eas.patch
 rhel6.3/ext4-disable-mb-cache.patch
 rhel6.3/ext4-back-dquot-to.patch
 rhel6.3/ext4-nocmtime-2.6.patch
-rhel6.4/ext4-vmalloc.patch
 rhel6.3/ext4-journal-callback.patch
 rhel6.3/ext4-store-tree-generation-at-find.patch
 rhel6.3/ext4_pdirop.patch
index 89125c6..14af33a 100644 (file)
@@ -1,3 +1,7 @@
+rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch
+rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch
+rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch
+rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch
 rhel6.3/ext4-wantedi-2.6.patch
 rhel6.3/ext4-map_inode_page-2.6.18.patch
 rhel6.3/export-ext4-2.6.patch
@@ -30,7 +34,6 @@ rhel6.3/ext4-large-eas.patch
 rhel6.3/ext4-disable-mb-cache.patch
 rhel6.3/ext4-back-dquot-to.patch
 rhel6.3/ext4-nocmtime-2.6.patch
-rhel6.3/ext4-vmalloc.patch
 rhel6.3/ext4-journal-callback.patch
 rhel6.3/ext4-store-tree-generation-at-find.patch
 rhel6.3/ext4_pdirop.patch
index 53aa553..97ba519 100644 (file)
@@ -6,6 +6,10 @@ rhel6.3/ext4-nlink-2.6.patch
 sles11sp1/ext4-ext_generation.patch
 rhel6.3/ext4-inode-version.patch
 sles11sp1/ext4-update-sles11-rhel6.patch
+rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch
+rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch
+rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch
+rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch
 rhel6.3/ext4-mmp.patch
 rhel6.3/ext4-lookup-dotdot.patch
 rhel6.3/ext4-print-inum-in-htree-warning.patch
@@ -32,7 +36,6 @@ rhel6.3/ext4-disable-mb-cache.patch
 rhel6.3/ext4-back-dquot-to.patch
 rhel6.3/ext4-nocmtime-2.6.patch
 rhel6.3/ext4-export-64bit-name-hash.patch
-rhel6.3/ext4-vmalloc.patch
 rhel6.3/ext4-journal-callback.patch
 rhel6.3/ext4-store-tree-generation-at-find.patch
 rhel6.3/ext4_pdirop.patch