Skip to content
  • Valerie Clement's avatar
    ext4: modify block allocation algorithm for the last group · 74d3487f
    Valerie Clement authored
    
    
    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: default avatarValerie Clement <valerie.clement@bull.net>
    Signed-off-by: default avatarMingming Cao <cmm@us.ibm.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    74d3487f