linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Yunlei He <heyunlei@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com,
	linux-f2fs-devel@lists.sourceforge.net
Cc: heyunlei@huawei.com, morgan.wang@huawei.com
Subject: [PATCH] f2fs: fix a infinite loop in writting checkpoint
Date: Sat, 26 Aug 2017 12:15:35 +0800	[thread overview]
Message-ID: <1503720935-23349-1-git-send-email-heyunlei@huawei.com> (raw)

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

             reply	other threads:[~2017-08-26  4:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-26  4:15 Yunlei He [this message]
2017-08-28  9:49 ` [PATCH] f2fs: fix a infinite loop in writting checkpoint Chao Yu
2017-09-01  4:19   ` 答复: " heyunlei
2017-09-04  1:24     ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503720935-23349-1-git-send-email-heyunlei@huawei.com \
    --to=heyunlei@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=morgan.wang@huawei.com \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).