]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix to avoid overflow when left shifting page offset
authorChao Yu <yuchao0@huawei.com>
Wed, 25 Jan 2017 02:52:39 +0000 (10:52 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 23 Feb 2017 04:24:51 +0000 (20:24 -0800)
commit4b332da6a9cbe87f5ebb09b7b4c95163fa82b0f8
treedfbba41ac9cfc88c2e20e32b41a857dba6357c07
parent01ed5d422fe8e4fb2fc8d084dd8830ef1485e9d7
f2fs: fix to avoid overflow when left shifting page offset

We use following method to calculate size with current page index:
size = index << PAGE_SHIFT
If type of index has only 32-bits size, left shifting will incur overflow,
which makes result incorrect.

So let's cast index with 64-bits type to avoid such issue.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/recovery.c