aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/balloc.c
diff options
context:
space:
mode:
authorMingming Cao <cmm@us.ibm.com>2006-12-06 23:38:19 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:39 -0500
commit1df1e63b9e9340015c01b85817568fb9afde10bc (patch)
tree10961392c3915cfe1b8317206b3993ed0e4596a6 /fs/ext4/balloc.c
parent2bd94bd79e5bfa217714f78e5d6d7b6517ca546f (diff)
[PATCH] ext4: fix reservation extension
Hugh Dickins wrote: > Not found anything relevant, but I keep noticing these lines > in ext2_try_to_allocate_with_rsv(), ext3 and ext4 similar: > > } else if (grp_goal > 0 && > (my_rsv->rsv_end - grp_goal + 1) < *count) > try_to_extend_reservation(my_rsv, sb, > *count-my_rsv->rsv_end + grp_goal - 1); > > They're wrong, a no-op in most groups, aren't they? rsv_end is an > absolute block number, whereas grp_goal is group-relative, so the > calculation ought to bring in group_first_block? Or I'm confused. > Signed-off-by: Mingming Cao <cmm@us.ibm.com> Cc: "linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org> Cc: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r--fs/ext4/balloc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 5d45582f9517..6bd0bd5bbdc8 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -1324,10 +1324,14 @@ ext4_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle,
1324 if (!goal_in_my_reservation(&my_rsv->rsv_window, 1324 if (!goal_in_my_reservation(&my_rsv->rsv_window,
1325 grp_goal, group, sb)) 1325 grp_goal, group, sb))
1326 grp_goal = -1; 1326 grp_goal = -1;
1327 } else if (grp_goal > 0 && 1327 } else if (grp_goal > 0) {
1328 (my_rsv->rsv_end-grp_goal+1) < *count) 1328 int curr = my_rsv->rsv_end -
1329 try_to_extend_reservation(my_rsv, sb, 1329 (grp_goal + group_first_block) + 1;
1330 *count-my_rsv->rsv_end + grp_goal - 1); 1330
1331 if (curr < *count)
1332 try_to_extend_reservation(my_rsv, sb,
1333 *count - curr);
1334 }
1331 1335
1332 if ((my_rsv->rsv_start > group_last_block) || 1336 if ((my_rsv->rsv_start > group_last_block) ||
1333 (my_rsv->rsv_end < group_first_block)) { 1337 (my_rsv->rsv_end < group_first_block)) {