fsck.f2fs: write back last cp block in the end
PATCH 1/1 fsck.f2fs: write back last cp block in the end
Write back last cp block in the end in case of sudden power off during fsck process
Signed-off-by Yunlei He <[email protected]>
--- fsck/mount.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
fsck/mount.c +7 -4
@@ -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)
Signature · 6 lines
1.9.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 4 lines · Yunlei He
Write back last cp block in the end in case of sudden power off during fsck process
Signed-off-by Yunlei He <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Quoted 20 lines
--- fsck/mount.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)fsck/mount.c +0
-4@@ -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);
fsck/mount.c void write_checkpoint(struct f2fs_sb_info *sbi) · line 1933
Quoted 10 lines
fsck/mount.c +7
-0+ +/* 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