Whamcloud - gitweb
LU-477 allocate memory for s_group_desc and s_group_info by vmalloc()
authorYu Jian <yujian@whamcloud.com>
Thu, 7 Jul 2011 12:55:51 +0000 (20:55 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 8 Jul 2011 18:14:17 +0000 (11:14 -0700)
commite2d082eb4451488baea54be34410371122adf0d5
treeaeb83249a2e8de98331cabddb5a38d8520cf0078
parent5c1e9f9dada5f2f44a4fc9f46c4bb0789b747df6
LU-477 allocate memory for s_group_desc and s_group_info by vmalloc()

Large kmalloc() for sbi->s_group_desc and sbi->s_group_info can fail
for large filesystems, which will cause the "not enough memory" error
while mounting. This patch makes it fall back to vmalloc() if the
kmalloc() failed, as what was done for sbi->s_flex_groups.

To avoid colliding with an valid on-disk inode number, EXT4_BAD_INO
is used as the number of the buddy cache inode.

The patch also incorporates the following upstream kernel fix:

commit 32a9bb57d7c1fd04ae0f72b8f671501f000a0e9f
ext4: fix missing iput of root inode for some mount error paths
https://bugzilla.kernel.org/show_bug.cgi?id=26752

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: I3950425835ea7f2968ceb2edbc622e3ff3ed8545
Reviewed-on: http://review.whamcloud.com/1071
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
ldiskfs/kernel_patches/patches/ext4-vmalloc-rhel5.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series