Skip to content

Commit

Permalink
ext4: fix data offset overflow on 32-bit archs in ext4_inline_data_fi…
Browse files Browse the repository at this point in the history
…emap()

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>
  • Loading branch information
Jan Kara authored and Theodore Ts'o committed May 31, 2013
1 parent 566370a commit eaf3793
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/inline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eaf3793

Please sign in to comment.