linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix a infinite loop in writting checkpoint
@ 2017-08-26  4:15 Yunlei He
  2017-08-28  9:49 ` Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Yunlei He @ 2017-08-26  4:15 UTC (permalink / raw)
  To: jaegeuk, yuchao0, linux-f2fs-devel; +Cc: heyunlei, morgan.wang

The loop reason is DIRTY IMETA always equal to 1:

Thread A:
-write_checkpoint
   -block_operations
       -f2fs_sync_inode_meta
           -igrab       <--- here igrab return NULL

Thread B:
-f2fs_evict_inode
   -remove_inode_page
       -truncate_xattr_node
          -__get_node_page
             -read_node_page   <---- here return -ENOENT

This patch walk around this cause.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
---
 fs/f2fs/node.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 2654c91..ec7a0e0 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -973,8 +973,9 @@ int truncate_xattr_node(struct inode *inode, struct page *page)
 		return 0;
 
 	npage = get_node_page(sbi, nid);
-	if (IS_ERR(npage))
+	if (IS_ERR(npage) && PTR_ERR(npage) != -ENOENT) {
 		return PTR_ERR(npage);
+	}
 
 	f2fs_i_xnid_write(inode, 0);
 
-- 
1.9.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-04  1:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-26  4:15 [PATCH] f2fs: fix a infinite loop in writting checkpoint Yunlei He
2017-08-28  9:49 ` Chao Yu
2017-09-01  4:19   ` 答复: " heyunlei
2017-09-04  1:24     ` 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).