* [f2fs-dev] [PATCH] f2fs: set SBI_NEED_FSCK flag when inconsistent node block found
@ 2021-09-18 12:46 Weichao Guo via Linux-f2fs-devel
2021-09-18 22:34 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: Weichao Guo via Linux-f2fs-devel @ 2021-09-18 12:46 UTC (permalink / raw)
To: jaegeuk, chao; +Cc: omega, linux-f2fs-devel
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>
---
fs/f2fs/node.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index e863136..556fcd8 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -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),
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);
--
2.7.4
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: set SBI_NEED_FSCK flag when inconsistent node block found
2021-09-18 12:46 [f2fs-dev] [PATCH] f2fs: set SBI_NEED_FSCK flag when inconsistent node block found Weichao Guo via Linux-f2fs-devel
@ 2021-09-18 22:34 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2021-09-18 22:34 UTC (permalink / raw)
To: Weichao Guo, jaegeuk; +Cc: omega, linux-f2fs-devel
On 2021/9/18 20:46, Weichao Guo wrote:
> 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>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-18 22:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-18 12:46 [f2fs-dev] [PATCH] f2fs: set SBI_NEED_FSCK flag when inconsistent node block found Weichao Guo via Linux-f2fs-devel
2021-09-18 22:34 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).