From: Oleg Drokin Date: Mon, 28 Nov 2005 21:43:53 +0000 (-0800) Subject: [PATCH] reiserfs: fix 32-bit overflow in map_block_for_writepage() X-Git-Tag: v2.6.15-rc3~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7729ac5efe156129d172784fedeaddb2167a1914;p=platform%2Fkernel%2Flinux-3.10.git [PATCH] reiserfs: fix 32-bit overflow in map_block_for_writepage() I now see another overflow in reiserfs that should lead to data corruptions with files that are bigger than 4G under certain circumstances when using mmap. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 5f82352..0a044ad 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -2194,7 +2194,7 @@ static int map_block_for_writepage(struct inode *inode, INITIALIZE_PATH(path); int pos_in_item; int jbegin_count = JOURNAL_PER_BALANCE_CNT; - loff_t byte_offset = (block << inode->i_sb->s_blocksize_bits) + 1; + loff_t byte_offset = ((loff_t)block << inode->i_sb->s_blocksize_bits)+1; int retval; int use_get_block = 0; int bytes_copied = 0;