f2fs: in-memory inode checksum when checking consistency
A message that is not in the archive (sent off-list or not yet received): [email protected]
Chao Yu
Reviewed-byQuoted 5 lines · Weichao Guo
Enable in-memory inode checksum to protect metadata blocks from in-memory scribbles only when checking consistency with no performance requirements.
Signed-off-by Weichao Guo <[email protected]>
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 8 lines · Chao Yu
Quoted 5 lines · Weichao Guo
Enable in-memory inode checksum to protect metadata blocks from in-memory scribbles only when checking consistency with no performance requirements.
Signed-off-by Weichao Guo <[email protected]>Reviewed-by Chao Yu <[email protected]>
This gives a panic easily by fsstress. Could you please check it again?
Thanks,
Quoted 2 lines
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 35 lines · Weichao Guo
Enable in-memory inode checksum to protect metadata blocks from in-memory scribbles only when checking consistency with no performance requirements.
Signed-off-by Weichao Guo <[email protected]>--- fs/f2fs/inode.c | 7 +++++++ fs/f2fs/node.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-)fs/f2fs/inode.c +7
-0@@ -159,8 +159,12 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page)struct f2fs_inode *ri;__u32 provided, calculated; +#ifdef CONFIG_F2FS_CHECK_FS +if (!f2fs_enable_inode_chksum (sbi, page)) +#elseif (!f2fs_enable_inode_chksum (sbi, page) || PageDirty(page) || PageWriteback(page)) +#endif return true; ri = &F2FS_NODE (page)->i;@@ -464,6 +468,9 @@ void update_inode_page(struct inode *inode)return ; }update_inode (inode, node_page); +#ifdef CONFIG_F2FS_CHECK_FS +f2fs_inode_chksum_set (sbi, node_page); +#endif
Quoted 1 line
This gives a panic easily by fsstress. Could you please check it again?
Sorry, I missed some cases, it looks that we need to cover updating place of all fields like i_addr, inline_xxx, footer with f2fs_inode_chksum_set.
Thanks,
Quoted 10 lines
fs/f2fs/inode.c +0
-0f2fs_put_page (node_page,1 ); }fs/f2fs/node.c +0
-0@@ -1113,8 +1113,10 @@ static int read_node_page(struct page *page, int op_flags) .encrypted_page = NULL,
fs/f2fs/node.c static int read_node_page(struct page *page, int op_flags) · line 1122
Quoted 10 lines
fs/f2fs/node.c +3
-1}; -if (PageUptodate (page)) +if (PageUptodate (page)) { +f2fs_bug_on (sbi, !f2fs_inode_chksum_verify (sbi, page));return LOCKED_PAGE ; + }get_node_info (sbi, page->index, &ni);
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 36 lines · Chao Yu
Quoted 34 lines · Weichao Guo
Enable in-memory inode checksum to protect metadata blocks from in-memory scribbles only when checking consistency with no performance requirements.
Signed-off-by Weichao Guo <[email protected]>--- fs/f2fs/inode.c | 7 +++++++ fs/f2fs/node.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-)fs/f2fs/inode.c +7
-0@@ -159,8 +159,12 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page)struct f2fs_inode *ri;__u32 provided, calculated; +#ifdef CONFIG_F2FS_CHECK_FS +if (!f2fs_enable_inode_chksum (sbi, page)) +#elseif (!f2fs_enable_inode_chksum (sbi, page) || PageDirty(page) || PageWriteback(page)) +#endif return true; ri = &F2FS_NODE (page)->i;@@ -464,6 +468,9 @@ void update_inode_page(struct inode *inode)return ; }update_inode (inode, node_page); +#ifdef CONFIG_F2FS_CHECK_FS +f2fs_inode_chksum_set (sbi, node_page); +#endif
Quoted 5 lines
Quoted 1 line
This gives a panic easily by fsstress. Could you please check it again?
Sorry, I missed some cases, it looks that we need to cover updating place of all fields like
i_addr,inline_xxx, footer withf2fs_inode_chksum_set.
Sorry for that , I will do more test in the following. Thanks,
Quoted 19 lines
Thanks,
Quoted 17 lines
fs/f2fs/inode.c +0
-0f2fs_put_page (node_page,1 ); }fs/f2fs/node.c +3
-1@@ -1113,8 +1113,10 @@ static int read_node_page(struct page *page, int op_flags) .encrypted_page = NULL, }; -if (PageUptodate (page)) +if (PageUptodate (page)) { +f2fs_bug_on (sbi, !f2fs_inode_chksum_verify (sbi, page));return LOCKED_PAGE ; + }
Quoted 7 lines
fs/f2fs/node.c static int read_node_page(struct page *page, int op_flags) · line 1122
Quoted 3 lines
fs/f2fs/node.c +0
-0get_node_info (sbi, page->index, &ni);.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot