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

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length,

	iomap->flags = 0;
	iomap->bdev = inode->i_sb->s_bdev;
	iomap->offset = first_block << blkbits;
	iomap->offset = (u64)first_block << blkbits;

	if (ret == 0) {
		iomap->type = IOMAP_HOLE;