Index: linux-2.6.24-rc1/fs/ext4/mballoc.c =================================================================== --- linux-2.6.24-rc1.orig/fs/ext4/mballoc.c 2007-10-27 10:29:17.000000000 +0400 +++ linux-2.6.24-rc1/fs/ext4/mballoc.c 2007-10-27 22:14:54.000000000 +0400 @@ -3088,8 +3088,10 @@ static void ext4_mb_normalize_request(st break; } } + size = wind; + if (wind == 0) { - __u64 tstart; + __u64 tstart, tend; /* file is quite large, we now preallocate with * the biggest configured window with regart to * logical offset */ @@ -3097,8 +3099,11 @@ static void ext4_mb_normalize_request(st tstart = ac->ac_o_ex.fe_logical; do_div(tstart, wind); start = tstart * wind; + tend = ac->ac_o_ex.fe_logical + ac->ac_o_ex.fe_len - 1; + do_div(tend, wind); + tend = tend * wind + wind; + size = tend - start; } - size = wind; orig_size = size; orig_start = start;