Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ext4 balloc: fix _with_rsv freeze

Port fix to the off-by-one in find_next_usable_block's memscan from ext2 to
ext4; but it didn't cause a serious problem for ext4 because the additional
ext4_test_allocatable check rescued it from the error.

[akpm@osdl.org: build fix]
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>

authored by

Hugh Dickins and committed by
Linus Torvalds
ec0837f2 341cee43

+1 -1
+1 -1
fs/ext4/balloc.c
··· 747 747 here = 0; 748 748 749 749 p = ((char *)bh->b_data) + (here >> 3); 750 - r = memscan(p, 0, (maxblocks - here + 7) >> 3); 750 + r = memscan(p, 0, ((maxblocks + 7) >> 3) - (here >> 3)); 751 751 next = (r - ((char *)bh->b_data)) << 3; 752 752 753 753 if (next < maxblocks && next >= start && ext4_test_allocatable(next, bh))