Commit d5bfccdf authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dave Chinner

ext2: fix possible integer truncation in ext2_iomap_begin

For 32-bit architectures we need to cast first_block to u64 before
shifting it left.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reported-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 25f4e702
...@@ -806,7 +806,7 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length, ...@@ -806,7 +806,7 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
iomap->flags = 0; iomap->flags = 0;
iomap->bdev = inode->i_sb->s_bdev; iomap->bdev = inode->i_sb->s_bdev;
iomap->offset = first_block << blkbits; iomap->offset = (u64)first_block << blkbits;
if (ret == 0) { if (ret == 0) {
iomap->type = IOMAP_HOLE; iomap->type = IOMAP_HOLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment