]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
ext4: modify block allocation algorithm for the last group
authorValerie Clement <valerie.clement@bull.net>
Fri, 15 Feb 2008 18:43:07 +0000 (13:43 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 15 Feb 2008 18:43:07 +0000 (13:43 -0500)
commit74d3487fc8aa58cec16dff7239dea1ca59bdab0e
treee7f2e3b107bc7ff98ae4a02d0deb44809ae53394
parente56eb6590693a5a340e8f596db2768a6e1b9e236
ext4: modify block allocation algorithm for the last group

When a directory inode is allocated in the last group and the last group
contains less than s_blocks_per_group blocks, the initial block allocated
for the directory is not always allocated in the same group as the
directory inode, but in one of the first groups of the filesystem (group 1
for example).
Depending on the current process's pid, ext4_find_near() and
ext4_ext_find_goal() can return a block number greater than the maximum
blocks count in the filesystem and in that case the block will be not
allocated in the same group as the inode.

The following patch fixes the problem.

Should the modification also be done in ext2/3 code?

Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c
fs/ext4/inode.c