linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: heyunlei <heyunlei@huawei.com>,
	"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
	"linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Cc: "Wangkai (Morgan, Euler)" <morgan.wang@huawei.com>
Subject: Re: 答复: [PATCH] f2fs: fix a infinite loop in writting checkpoint
Date: Mon, 4 Sep 2017 09:24:55 +0800	[thread overview]
Message-ID: <dd4604c0-27d3-88aa-cbd0-0981998773ff@huawei.com> (raw)
In-Reply-To: <42B685BFA705F94C860C6DD0752F05654802B6F4@DGGEMA503-MBX.china.huawei.com>

On 2017/9/1 12:19, heyunlei wrote:
> 
> Hi Yunlei,
> 
> On 2017/8/26 12:15, Yunlei He wrote:
>> 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.
> 
> It needs to figure out root cause that why xattr node entry is invalid.
> 
> How about this modification:
> 
> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> index b4c401d..62de5f7 100644
> --- a/fs/f2fs/inode.c
> +++ b/fs/f2fs/inode.c
> @@ -497,7 +497,7 @@ void f2fs_evict_inode(struct inode *inode)
>                 f2fs_lock_op(sbi);
>                 err = remove_inode_page(inode);
>                 f2fs_unlock_op(sbi);
> -               if (err == -ENOENT)
> +               if (err == -ENOENT && is_bad_inode(inode))

So we expect that before new inode page was allocated, it needs to set bad inode
in time covering all error paths?

Thanks,

>                         err = 0;
>         }
> 
> Thanks
> 
>>
>> 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);
>>  
>>
> 


------------------------------------------------------------------------------
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-09-04  1:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=dd4604c0-27d3-88aa-cbd0-0981998773ff@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=heyunlei@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=morgan.wang@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).