f2fs: don't need to invalidate wrong node page
Subsystems (2)
Jaegeuk Kim
maintainerPATCH 1/2 f2fs: don't need to invalidate wrong node page
If f2fs_new_inode() is failed, the bad inode will invalidate 0'th node page during f2fs_evict_inode(), which doesn't need to do.
--- fs/f2fs/inode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/f2fs/inode.c +4 -1
@@ -411,7 +411,10 @@ void f2fs_evict_inode(struct inode *inode)stat_dec_inline_dir (inode);stat_dec_inline_inode (inode); -invalidate_mapping_pages (NODE_MAPPING (sbi), inode->i_ino, inode->i_ino); +/* ino == 0, if f2fs_new_inode() was failed t*/ +if (inode->i_ino) +invalidate_mapping_pages (NODE_MAPPING (sbi), inode->i_ino, + inode->i_ino);if (xnid)invalidate_mapping_pages (NODE_MAPPING (sbi), xnid, xnid);if (inode->i_nlink) {
Signature · 9 lines
2.11.0 ------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford
Jaegeuk Kim
maintainerPATCH 2/2 f2fs: don't overwrite node block by SSR
This patch fixes that SSR can overwrite previous warm node block consisting of a node chain since the last checkpoint.
--- fs/f2fs/segment.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/segment.c +6 -0
@@ -1177,6 +1177,12 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)if (f2fs_discard_en (sbi) && !f2fs_test_and_set_bit (offset, se->discard_map)) sbi->discard_blks--; + +/* don't overwrite by SSR to keep node chain */ +if (se->type ==CURSEG_WARM_NODE ) { +if (!f2fs_test_and_set_bit (offset, se->ckpt_valid_map)) + se->ckpt_valid_blocks++; + } }else {if (!f2fs_test_and_clear_bit (offset, se->cur_valid_map)) {#ifdef CONFIG_F2FS_CHECK_FS
Signature · 9 lines
2.11.0 ------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford
Re: [f2fs-dev] [PATCH 2/2] f2fs: don't overwrite node block by SSR
Quoted 2 lines · Jaegeuk Kim
This patch fixes that SSR can overwrite previous warm node block consisting of a node chain since the last checkpoint.
Good catch!
Need to consider the impact to other accesser, e.g. is_checkpointed_data, add_discard_addrs?
Thanks,
Quoted 25 lines
Fixes 5b6c6be2d878 ("f2fs: use SSR for warm node as well")Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/segment.c | 6 ++++++ 1 file changed, 6 insertions(+)fs/f2fs/segment.c +6
-0@@ -1177,6 +1177,12 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)if (f2fs_discard_en (sbi) && !f2fs_test_and_set_bit (offset, se->discard_map)) sbi->discard_blks--; + +/* don't overwrite by SSR to keep node chain */ +if (se->type ==CURSEG_WARM_NODE ) { +if (!f2fs_test_and_set_bit (offset, se->ckpt_valid_map)) + se->ckpt_valid_blocks++; + } }else {if (!f2fs_test_and_clear_bit (offset, se->cur_valid_map)) {#ifdef CONFIG_F2FS_CHECK_FS
Jaegeuk Kim
maintainerRe: [f2fs-dev] [PATCH 2/2] f2fs: don't overwrite node block by SSR
Quoted 8 lines · Chao Yu
Quoted 2 lines · Jaegeuk Kim
This patch fixes that SSR can overwrite previous warm node block consisting of a node chain since the last checkpoint.
Good catch!
Need to consider the impact to other accesser, e.g.
is_checkpointed_data,add_discard_addrs?
I've checked them. is_checkpointed_data() has nothing to do with this warm node and this prevents add_discard_addrs to issue discard command.
Thanks,
Quoted 20 lines
Thanks,
Quoted 17 lines
Fixes 5b6c6be2d878 ("f2fs: use SSR for warm node as well")Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/segment.c | 6 ++++++ 1 file changed, 6 insertions(+)fs/f2fs/segment.c +2
-0@@ -1177,6 +1177,12 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)if (f2fs_discard_en (sbi) && !f2fs_test_and_set_bit (offset, se->discard_map)) sbi->discard_blks--; + +/* don't overwrite by SSR to keep node chain */
Quoted 8 lines
fs/f2fs/segment.c static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del) · line 1188
Quoted 8 lines
fs/f2fs/segment.c +4
-0+if (se->type ==CURSEG_WARM_NODE ) { +if (!f2fs_test_and_set_bit (offset, se->ckpt_valid_map)) + se->ckpt_valid_blocks++; + } }else {if (!f2fs_test_and_clear_bit (offset, se->cur_valid_map)) {#ifdef CONFIG_F2FS_CHECK_FS
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition.
http://sdm.link/oxford
Chao Yu
Reviewed-byRe: [f2fs-dev] [PATCH 2/2] f2fs: don't overwrite node block by SSR
Quoted 5 lines · Jaegeuk Kim
Quoted 4 lines · Chao Yu
Quoted 2 lines · Jaegeuk Kim
This patch fixes that SSR can overwrite previous warm node block consisting of a node chain since the last checkpoint.
Quoted 7 lines
Quoted 4 lines
Good catch!
Need to consider the impact to other accesser, e.g.
is_checkpointed_data,add_discard_addrs?I've checked them.
is_checkpointed_data()has nothing to do with this warm node and this preventsadd_discard_addrsto issue discard command.
That's right.
Thanks,
Quoted 34 lines
Thanks,
Quoted 20 lines
Thanks,
Quoted 17 lines
Fixes 5b6c6be2d878 ("f2fs: use SSR for warm node as well")Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/segment.c | 6 ++++++ 1 file changed, 6 insertions(+)fs/f2fs/segment.c +2
-0@@ -1177,6 +1177,12 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)if (f2fs_discard_en (sbi) && !f2fs_test_and_set_bit (offset, se->discard_map)) sbi->discard_blks--; + +/* don't overwrite by SSR to keep node chain */ Quoted 8 lines
fs/f2fs/segment.c static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del) · line 1188
Quoted 8 lines
fs/f2fs/segment.c +4
-0+if (se->type ==CURSEG_WARM_NODE ) { +if (!f2fs_test_and_set_bit (offset, se->ckpt_valid_map)) + se->ckpt_valid_blocks++; + } }else {if (!f2fs_test_and_clear_bit (offset, se->cur_valid_map)) {#ifdef CONFIG_F2FS_CHECK_FS .
Quoted 2 lines · Jaegeuk Kim
If
f2fs_new_inode()is failed, the bad inode will invalidate 0'th node page duringf2fs_evict_inode(), which doesn't need to do.
Hmm...should not allow other using of inode->i_ino in following codes of f2fs_evict_inode, right?
Thanks,
Quoted 23 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/inode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/f2fs/inode.c +4
-1@@ -411,7 +411,10 @@ void f2fs_evict_inode(struct inode *inode)stat_dec_inline_dir (inode);stat_dec_inline_inode (inode); -invalidate_mapping_pages (NODE_MAPPING (sbi), inode->i_ino, inode->i_ino); +/* ino == 0, if f2fs_new_inode() was failed t*/ +if (inode->i_ino) +invalidate_mapping_pages (NODE_MAPPING (sbi), inode->i_ino, + inode->i_ino);if (xnid)invalidate_mapping_pages (NODE_MAPPING (sbi), xnid, xnid);if (inode->i_nlink) {
Jaegeuk Kim
maintainerQuoted 6 lines · Chao Yu
Quoted 2 lines · Jaegeuk Kim
If
f2fs_new_inode()is failed, the bad inode will invalidate 0'th node page duringf2fs_evict_inode(), which doesn't need to do.Hmm...should not allow other using of
inode->i_inoin following codes off2fs_evict_inode, right?
Right.
Quoted 26 lines
Thanks,
Quoted 23 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/inode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/f2fs/inode.c +4
-1@@ -411,7 +411,10 @@ void f2fs_evict_inode(struct inode *inode)stat_dec_inline_dir (inode);stat_dec_inline_inode (inode); -invalidate_mapping_pages (NODE_MAPPING (sbi), inode->i_ino, inode->i_ino); +/* ino == 0, if f2fs_new_inode() was failed t*/ +if (inode->i_ino) +invalidate_mapping_pages (NODE_MAPPING (sbi), inode->i_ino, + inode->i_ino);if (xnid)invalidate_mapping_pages (NODE_MAPPING (sbi), xnid, xnid);if (inode->i_nlink) {
Chao Yu
Reviewed-byQuoted 9 lines · Jaegeuk Kim
Quoted 6 lines · Chao Yu
Quoted 2 lines · Jaegeuk Kim
If
f2fs_new_inode()is failed, the bad inode will invalidate 0'th node page duringf2fs_evict_inode(), which doesn't need to do.Hmm...should not allow other using of
inode->i_inoin following codes off2fs_evict_inode, right?Right.
I mean those codes below invalidate_mapping_pages(NODE_MAPPING(sbi),,) After having a look at them, I think it's OK without any change. :)
Thanks,
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition.
http://sdm.link/oxford