diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-09-18 03:36:06 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-09-28 20:39:58 +0300 |
commit | edc55aaf0d1712b54a3704dd58423c7e495534fe (patch) | |
tree | c3f2bf974a3706d91b231b309c2c9427d9adfe5b /fs/f2fs/segment.c | |
parent | 4a1728cad6340bfbe17bd17fd158b2165cd99508 (diff) | |
download | linux-edc55aaf0d1712b54a3704dd58423c7e495534fe.tar.xz |
f2fs: avoid f2fs_bug_on if f2fs_get_meta_page_nofail got EIO
This patch avoids BUG_ON when f2fs_get_meta_page_nofail got EIO during
xfstests/generic/475.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 97a4fae75651..d33e9d0d5d47 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2429,6 +2429,7 @@ static void change_curseg(struct f2fs_sb_info *sbi, int type) __next_free_blkoff(sbi, curseg, 0); sum_page = f2fs_get_sum_page(sbi, new_segno); + f2fs_bug_on(sbi, IS_ERR(sum_page)); sum_node = (struct f2fs_summary_block *)page_address(sum_page); memcpy(curseg->sum_blk, sum_node, SUM_ENTRY_SIZE); f2fs_put_page(sum_page, 1); @@ -3903,6 +3904,8 @@ static int build_sit_entries(struct f2fs_sb_info *sbi) se = &sit_i->sentries[start]; page = get_current_sit_page(sbi, start); + if (IS_ERR(page)) + return PTR_ERR(page); sit_blk = (struct f2fs_sit_block *)page_address(page); sit = sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, start)]; f2fs_put_page(page, 1); |