From: Chao Yu <yuchao0@huawei.com>
To: Yunlong Song <yunlong.song@huawei.com>, <jaegeuk@kernel.org>,
<cm224.lee@samsung.com>, <chao@kernel.org>, <sylinux@163.com>,
<miaoxie@huawei.com>
Cc: <bintian.wang@huawei.com>, <linux-fsdevel@vger.kernel.org>,
<linux-f2fs-devel@lists.sourceforge.net>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] f2fs: put allocate_segment after refresh_sit_entry
Date: Fri, 24 Feb 2017 09:33:16 +0800 [thread overview]
Message-ID: <00a9826a-f6a7-cba5-ba3f-e740b060e03c@huawei.com> (raw)
In-Reply-To: <1487667566-2110-1-git-send-email-yunlong.song@huawei.com>
On 2017/2/21 16:59, Yunlong Song wrote:
> SIT information should be updated before segment allocation, since SSR needs
> latest valid block information. Current code does not update the old_blkaddr
> info in sit_entry, so adjust the allocate_segment to its proper location. Commit
> 5e443818fa0b2a2845561ee25bec181424fb2889 ("f2fs: handle dirty segments inside
> refresh_sit_entry") puts it into wrong location.
Not a big deal, because we only count invalid block which has been checkpointed,
so current order won't change the result of allocation with SSR.
Anyway, it's OK to me. :)
Reviewed-by: Chao Yu <yuchao0@huawei.com>
>
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> ---
> fs/f2fs/segment.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index df2ff5c..89052df 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1743,14 +1743,15 @@ void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
>
> stat_inc_block_count(sbi, curseg);
>
> - if (!__has_curseg_space(sbi, type))
> - sit_i->s_ops->allocate_segment(sbi, type, false);
> /*
> * SIT information should be updated before segment allocation,
> * since SSR needs latest valid block information.
> */
> refresh_sit_entry(sbi, old_blkaddr, *new_blkaddr);
>
> + if (!__has_curseg_space(sbi, type))
> + sit_i->s_ops->allocate_segment(sbi, type, false);
> +
> mutex_unlock(&sit_i->sentry_lock);
>
> if (page && IS_NODESEG(type))
>
prev parent reply other threads:[~2017-02-24 1:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 8:59 Yunlong Song
2017-02-24 1:33 ` 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=00a9826a-f6a7-cba5-ba3f-e740b060e03c@huawei.com \
--to=yuchao0@huawei.com \
--cc=bintian.wang@huawei.com \
--cc=chao@kernel.org \
--cc=cm224.lee@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=sylinux@163.com \
--cc=yunlong.song@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
all inboxes | Powered by JetHome®