__generic_block_fiemap(): fix for files bigger than 4GB
authorMike Hommey <[email protected]>
Wed, 11 Nov 2009 22:26:55 +0000 (14:26 -0800)
committerLinus Torvalds <[email protected]>
Thu, 12 Nov 2009 15:26:01 +0000 (07:26 -0800)
Because of an integer overflow on start_blk, various kind of wrong results
would be returned by the generic_block_fiemap() handler, such as no
extents when there is a 4GB+ hole at the beginning of the file, or wrong
fe_logical when an extent starts after the first 4GB.

Signed-off-by: Mike Hommey <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Steven Whitehouse <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Cc: Eric Sandeen <[email protected]>
Cc: Josef Bacik <[email protected]>
Cc: Mark Fasheh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/ioctl.c

index 7b17a14396ff792152ae6da49d178355d5a5e7ea..6c751106c2e56c7bc318a0fa5f42f528fb8ac363 100644 (file)
@@ -254,7 +254,7 @@ int __generic_block_fiemap(struct inode *inode,
                           u64 len, get_block_t *get_block)
 {
        struct buffer_head tmp;
-       unsigned int start_blk;
+       unsigned long long start_blk;
        long long length = 0, map_len = 0;
        u64 logical = 0, phys = 0, size = 0;
        u32 flags = FIEMAP_EXTENT_MERGED;