Skip to content

Commit 6663b13

Browse files
weichao-guoJaegeuk Kim
authored andcommitted
f2fs: set SBI_NEED_FSCK flag when inconsistent node block found
Inconsistent node block will cause a file fail to open or read, which could make the user process crashes or stucks. Let's mark SBI_NEED_FSCK flag to trigger a fix at next fsck time. After unlinking the corrupted file, the user process could regenerate a new one and work correctly. Signed-off-by: Weichao Guo <guoweichao@oppo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 287b140 commit 6663b13

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/f2fs/node.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,7 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
14431443
nid, nid_of_node(page), ino_of_node(page),
14441444
ofs_of_node(page), cpver_of_node(page),
14451445
next_blkaddr_of_node(page));
1446+
set_sbi_flag(sbi, SBI_NEED_FSCK);
14461447
err = -EINVAL;
14471448
out_err:
14481449
ClearPageUptodate(page);

0 commit comments

Comments
 (0)