mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: don't overwrite node block by SSR
Date: Thu, 9 Mar 2017 20:07:48 +0800	[thread overview]
Message-ID: <9a3cfd97-150e-e1b8-8c22-1ddc475b492e@huawei.com> (raw)
In-Reply-To: <20170308213955.GC5483@jaegeuk.local>

On 2017/3/9 5:39, Jaegeuk Kim wrote:
> On 03/08, Chao Yu wrote:
>> On 2017/3/7 5:51, Jaegeuk Kim wrote:
>>> 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.

That's right.

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> 
> Thanks,
> 
>>
>> Thanks,
>>
>>>
>>> Fixes: 5b6c6be2d878 ("f2fs: use SSR for warm node as well")
>>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>>> ---
>>>  fs/f2fs/segment.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>>> index 2ae36d04d03e..684b869e1861 100644
>>> --- a/fs/f2fs/segment.c
>>> +++ b/fs/f2fs/segment.c
>>> @@ -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
>>>
> 
> .
> 

  reply	other threads:[~2017-03-09 12:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 21:51 [PATCH 1/2] f2fs: don't need to invalidate wrong node page Jaegeuk Kim
2017-03-06 21:51 ` [PATCH 2/2] f2fs: don't overwrite node block by SSR Jaegeuk Kim
2017-03-08 12:30   ` [f2fs-dev] " Chao Yu
2017-03-08 21:39     ` Jaegeuk Kim
2017-03-09 12:07       ` Chao Yu [this message]
2017-03-08 12:17 ` [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page Chao Yu
2017-03-08 21:35   ` Jaegeuk Kim
2017-03-09 11:36     ` 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=9a3cfd97-150e-e1b8-8c22-1ddc475b492e@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®