f2fs: handle newly created page when revoking inmem pages
authorDaeho Jeong <daeho.jeong@samsung.com>
Wed, 10 Jan 2018 07:49:10 +0000 (16:49 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 27 Jan 2018 21:30:06 +0000 (13:30 -0800)
commit75ae50cf1539b981dad0e86a2a46532cbfc10d87
treef9316eeb37972b7331c6c23d6768578f6e3458de
parent871b97493627b8f9faae5848ee35915fa776c0c0
f2fs: handle newly created page when revoking inmem pages

When committing inmem pages is successful, we revoke already committed
blocks in __revoke_inmem_pages() and finally replace the committed
ones with the old blocks using f2fs_replace_block(). However, if
the committed block was newly created one, the address of the old
block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
as new_blkaddr properly and a kernel panic occurrs.

Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
Tested-by: Shu Tan <shu.tan@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c