Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51be334d authored by Weichao Guo's avatar Weichao Guo Committed by Greg Kroah-Hartman
Browse files

f2fs: set SBI_NEED_FSCK flag when inconsistent node block found



[ Upstream commit 6663b138ded1a59e630c9e605e42aa7fde490cdc ]

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: default avatarWeichao Guo <guoweichao@oppo.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 3ceecea0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1385,6 +1385,7 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
			  nid, nid_of_node(page), ino_of_node(page),
			  ofs_of_node(page), cpver_of_node(page),
			  next_blkaddr_of_node(page));
		set_sbi_flag(sbi, SBI_NEED_FSCK);
		err = -EINVAL;
out_err:
		ClearPageUptodate(page);