提交 d5bfccdf 编写于 作者: C Christoph Hellwig 提交者: 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: NChristoph Hellwig <hch@lst.de>
Reported-by: NJan Kara <jack@suse.cz>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 25f4e702
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册