ext4: fix data offset overflow on 32-bit archs in ext4_inline_data_fiemap()
authorJan Kara <jack@suse.cz>
Fri, 31 May 2013 23:33:42 +0000 (19:33 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 31 May 2013 23:33:42 +0000 (19:33 -0400)
On 32-bit archs when sector_t is defined as 32-bit the logic computing
data offset in ext4_inline_data_fiemap(). Fix that by properly typing
the shifted value.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inline.c

index 3e2bf87..33331b4 100644 (file)
@@ -1842,7 +1842,7 @@ int ext4_inline_data_fiemap(struct inode *inode,
        if (error)
                goto out;
 
-       physical = iloc.bh->b_blocknr << inode->i_sb->s_blocksize_bits;
+       physical = (__u64)iloc.bh->b_blocknr << inode->i_sb->s_blocksize_bits;
        physical += (char *)ext4_raw_inode(&iloc) - iloc.bh->b_data;
        physical += offsetof(struct ext4_inode, i_block);
        length = i_size_read(inode);