]> git.baikalelectronics.ru Git - kernel.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)
commit951002729f53d9445ea1a523d65611f01931b84d
treee7f2e3b107bc7ff98ae4a02d0deb44809ae53394
parent31120f99d0f2d9a1a1017b7f816639ead16e4500
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