linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: guoweichao <guoweichao@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com
Cc: heyunlei@huawei.com, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: no need to flush NAT bits if no enough space
Date: Mon, 5 Feb 2018 14:29:02 +0800	[thread overview]
Message-ID: <052906a5-7199-a98c-6348-7f145c99d3b2@huawei.com> (raw)
In-Reply-To: <20180205143050.190788-1-guoweichao@huawei.com>


On 2018/2/5 22:30, Weichao Guo wrote:
> NAT bits are saved at spare space in CP pack. Flushed NAT bits
> may be overwritten by the CP pack if there is no enough space
> for NAT bits. And NAT bits will be obsolesced at next mount time
Sorry, there is a typo here. 'obsolesced' should be obsolete.

Thanks,

> if crc|cp_ver not matched. So just skip to flush NAT bits in such
> needless cases.
> 
> Signed-off-by: Weichao Guo <guoweichao@huawei.com>
> ---
>  fs/f2fs/checkpoint.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 0eaafb8..bdc03c9 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -1248,7 +1248,9 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
>  	start_blk = __start_cp_next_addr(sbi);
>  
>  	/* write nat bits */
> -	if (enabled_nat_bits(sbi, cpc)) {
> +	if (enabled_nat_bits(sbi, cpc) &&
> +			le32_to_cpu(ckpt->cp_pack_total_block_count) <=
> +			sbi->blocks_per_seg - NM_I(sbi)->nat_bits_blocks) {
>  		__u64 cp_ver = cur_cp_version(ckpt);
>  		block_t blk;
>  
> 


------------------------------------------------------------------------------
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:[~2018-02-05  6:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 14:30 [PATCH] f2fs: no need to flush NAT bits if no enough space Weichao Guo
2018-02-05  6:29 ` guoweichao [this message]
2018-02-05  7:42 ` Chao Yu
2018-02-05  7:49   ` guoweichao

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=052906a5-7199-a98c-6348-7f145c99d3b2@huawei.com \
    --to=guoweichao@huawei.com \
    --cc=heyunlei@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --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).