]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: Correct large hole offset calcuation
authorAllison Henderson <achender@linux.vnet.ibm.com>
Mon, 22 Aug 2011 19:04:53 +0000 (15:04 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 22 Aug 2011 19:04:53 +0000 (15:04 -0400)
commitae405042e38f4206ef99e9ffa048f4e5973d10f9
tree2f907c59375f4b9dca0c1842c06fcd38d4c51bf0
parent6c123c345b0438cd430c34862d468d291641bc33
ext4: Correct large hole offset calcuation

This bug was reported by Lukas Czerner while working on a
new patch to add discard support for loop devices using
punch hole.

The bug is happens because the data type for logical blocks is
not large enough to calculate the block offset for holes that are
very large.  This bug is resolved by casting the ext4_lblk_t
to an loff_t before calculating the byte offset of the block.

Reviewed-and-Tested-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c