mirror of
https://github.com/torvalds/linux
synced 2024-10-17 08:46:50 +00:00
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>
This commit is contained in:
parent
287b1406dd
commit
6663b138de
|
@ -1443,6 +1443,7 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
|
||||||
nid, nid_of_node(page), ino_of_node(page),
|
nid, nid_of_node(page), ino_of_node(page),
|
||||||
ofs_of_node(page), cpver_of_node(page),
|
ofs_of_node(page), cpver_of_node(page),
|
||||||
next_blkaddr_of_node(page));
|
next_blkaddr_of_node(page));
|
||||||
|
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
out_err:
|
out_err:
|
||||||
ClearPageUptodate(page);
|
ClearPageUptodate(page);
|
||||||
|
|
Loading…
Reference in a new issue