linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Yunlei He <heyunlei@huawei.com>,
	jaegeuk@kernel.org, yuchao0@huawei.com,
	linux-f2fs-devel@lists.sourceforge.net
Cc: morgan.wang@huawei.com
Subject: Re: [PATCH] fsck.f2fs: write back last cp block in the end
Date: Thu, 24 Aug 2017 22:23:49 +0800	[thread overview]
Message-ID: <dcdbcb79-2258-2430-f96a-9b7c3de82ce9@kernel.org> (raw)
In-Reply-To: <1503461584-4449-1-git-send-email-heyunlei@huawei.com>

On 2017/8/23 12:13, Yunlei He wrote:
> Write back last cp block in the end in case of sudden power off
> during fsck process
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>

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

> ---
>  fsck/mount.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/fsck/mount.c b/fsck/mount.c
> index a0b0bea..700a4ff 100644
> --- a/fsck/mount.c
> +++ b/fsck/mount.c
> @@ -1918,13 +1918,16 @@ void write_checkpoint(struct f2fs_sb_info *sbi)
>  		ASSERT(ret >= 0);
>  	}
>  
> -	/* write the last cp */
> -	ret = dev_write_block(cp, cp_blk_no++);
> -	ASSERT(ret >= 0);
> -
>  	/* Write nat bits */
>  	if (flags & CP_NAT_BITS_FLAG)
>  		write_nat_bits(sbi, sb, cp, sbi->cur_cp);
> +
> +	/* in case of sudden power off */
> +	f2fs_finalize_device();
> +
> +	/* write the last cp */
> +	ret = dev_write_block(cp, cp_blk_no++);
> +	ASSERT(ret >= 0);
>  }
>  
>  void build_nat_area_bitmap(struct f2fs_sb_info *sbi)
> 

------------------------------------------------------------------------------
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-24 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23  4:13 [PATCH] fsck.f2fs: write back last cp block in the end Yunlei He
2017-08-24 14:23 ` 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=dcdbcb79-2258-2430-f96a-9b7c3de82ce9@kernel.org \
    --to=chao@kernel.org \
    --cc=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).