linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs-tools: move_curseg_info only if check_curseg_offset fails
@ 2017-09-10 16:20 Yunlong Song
  2017-09-12  1:19 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Yunlong Song @ 2017-09-10 16:20 UTC (permalink / raw)
  To: jaegeuk, chao, yuchao0, yunlong.song, yunlong.song
  Cc: miaoxie, bintian.wang, linux-fsdevel, linux-f2fs-devel,
	linux-kernel

Current design will lose recovery process when check_curseg_offset is OK.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fsck/fsck.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index cb341ba..56a47be 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -2026,9 +2026,11 @@ int fsck_verify(struct f2fs_sb_info *sbi)
 			fix_hard_links(sbi);
 			fix_nat_entries(sbi);
 			rewrite_sit_area_bitmap(sbi);
-			move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
-			write_curseg_info(sbi);
-			flush_curseg_sit_entries(sbi);
+			if (check_curseg_offset(sbi)) {
+				move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
+				write_curseg_info(sbi);
+				flush_curseg_sit_entries(sbi);
+			}
 			fix_checkpoint(sbi);
 		} else if (is_set_ckpt_flags(cp, CP_FSCK_FLAG)) {
 			write_checkpoint(sbi);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] f2fs-tools: move_curseg_info only if check_curseg_offset fails
  2017-09-10 16:20 [PATCH] f2fs-tools: move_curseg_info only if check_curseg_offset fails Yunlong Song
@ 2017-09-12  1:19 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2017-09-12  1:19 UTC (permalink / raw)
  To: Yunlong Song, jaegeuk, chao, yunlong.song
  Cc: miaoxie, bintian.wang, linux-fsdevel, linux-f2fs-devel,
	linux-kernel

On 2017/9/11 0:20, Yunlong Song wrote:
> Current design will lose recovery process when check_curseg_offset is OK.
> 
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>

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

> ---
>  fsck/fsck.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/fsck/fsck.c b/fsck/fsck.c
> index cb341ba..56a47be 100644
> --- a/fsck/fsck.c
> +++ b/fsck/fsck.c
> @@ -2026,9 +2026,11 @@ int fsck_verify(struct f2fs_sb_info *sbi)
>  			fix_hard_links(sbi);
>  			fix_nat_entries(sbi);
>  			rewrite_sit_area_bitmap(sbi);
> -			move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
> -			write_curseg_info(sbi);
> -			flush_curseg_sit_entries(sbi);
> +			if (check_curseg_offset(sbi)) {
> +				move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
> +				write_curseg_info(sbi);
> +				flush_curseg_sit_entries(sbi);
> +			}
>  			fix_checkpoint(sbi);
>  		} else if (is_set_ckpt_flags(cp, CP_FSCK_FLAG)) {
>  			write_checkpoint(sbi);
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-12  1:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-10 16:20 [PATCH] f2fs-tools: move_curseg_info only if check_curseg_offset fails Yunlong Song
2017-09-12  1:19 ` Chao Yu

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).