Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e04b5ef8 authored by Mike Hommey's avatar Mike Hommey Committed by Linus Torvalds
Browse files

__generic_block_fiemap(): fix for files bigger than 4GB



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: default avatarMike Hommey <mh@glandium.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Eric Sandeen <sandeen@sgi.com>
Cc: Josef Bacik <jbacik@redhat.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 276b282e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -254,7 +254,7 @@ int __generic_block_fiemap(struct inode *inode,
			   u64 len, get_block_t *get_block)
			   u64 len, get_block_t *get_block)
{
{
	struct buffer_head tmp;
	struct buffer_head tmp;
	unsigned int start_blk;
	unsigned long long start_blk;
	long long length = 0, map_len = 0;
	long long length = 0, map_len = 0;
	u64 logical = 0, phys = 0, size = 0;
	u64 logical = 0, phys = 0, size = 0;
	u32 flags = FIEMAP_EXTENT_MERGED;
	u32 flags = FIEMAP_EXTENT_MERGED;