summaryrefslogtreecommitdiffstats
path: root/fs/ext3/balloc.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2006-12-07 05:41:30 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 17:39:48 +0100
commit7d1c520bb57e4b5e94ec937c13553dccf473341b (patch)
tree6e6ff8db13b6b8a3c122553bd5b1d43c7498ad77 /fs/ext3/balloc.c
parent[PATCH] ext3 balloc: use io_error label (diff)
downloadlinux-7d1c520bb57e4b5e94ec937c13553dccf473341b.tar.xz
linux-7d1c520bb57e4b5e94ec937c13553dccf473341b.zip
[PATCH] ext3 balloc: fix _with_rsv freeze
Port fix to the off-by-one in find_next_usable_block's memscan from ext2 to ext3; but it didn't cause a serious problem for ext3 because the additional ext3_test_allocatable check rescued it from the error. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext3/balloc.c')
-rw-r--r--fs/ext3/balloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index 5a2c198762f0..22161740ba29 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -730,7 +730,7 @@ find_next_usable_block(ext3_grpblk_t start, struct buffer_head *bh,
here = 0;
p = ((char *)bh->b_data) + (here >> 3);
- r = memscan(p, 0, (maxblocks - here + 7) >> 3);
+ r = memscan(p, 0, ((maxblocks + 7) >> 3) - (here >> 3));
next = (r - ((char *)bh->b_data)) << 3;
if (next < maxblocks && next >= start && ext3_test_allocatable(next, bh))