summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-10-03 00:46:04 +0200
committerDave Chinner <david@fromorbit.com>2016-10-03 00:46:04 +0200
commitd5bfccdf38d094f2b15fae8b361d7bd47f2509d6 (patch)
tree37d47bc6f016d5312faa9ccbd56da082b9835a75
parentext2: use iomap to implement DAX (diff)
downloadlinux-d5bfccdf38d094f2b15fae8b361d7bd47f2509d6.tar.xz
linux-d5bfccdf38d094f2b15fae8b361d7bd47f2509d6.zip
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>
-rw-r--r--fs/ext2/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index aae5f61f980b..c7dbb4661119 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -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;