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: Christoph Hellwig <hch@lst.de>
Reported-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index aae5f61..c7dbb46 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -806,7 +806,7 @@
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;