* Re: [f2fs-dev] [PATCH] f2fs-tools: do not put CP_UMOUNT_FLAG for roll forward recovery [not found] <20231027154935.1384979-1-daeho43@gmail.com> @ 2023-11-15 14:56 ` Chao Yu 0 siblings, 0 replies; 2+ messages in thread From: Chao Yu @ 2023-11-15 14:56 UTC (permalink / raw) To: Daeho Jeong, linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong On 2023/10/27 23:49, Daeho Jeong wrote: > From: Daeho Jeong <daehojeong@google.com> > > If we write CP_UMOUNT_FLAG in fsck, f2fs will not do foll forward recovery :s/foll/roll Otherwise, it looks good to me. Reviewed-by: Chao Yu <chao@kernel.org> Thanks, > even though it has to do. > > Signed-off-by: Daeho Jeong <daehojeong@google.com> > --- > fsck/fsck.c | 3 ++- > fsck/mount.c | 5 ++++- > include/f2fs_fs.h | 1 + > 3 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/fsck/fsck.c b/fsck/fsck.c > index f1a55db..126458c 100644 > --- a/fsck/fsck.c > +++ b/fsck/fsck.c > @@ -2526,7 +2526,8 @@ static void fix_checkpoint(struct f2fs_sb_info *sbi) > struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi); > struct f2fs_checkpoint *cp = F2FS_CKPT(sbi); > unsigned long long cp_blk_no; > - u32 flags = c.alloc_failed ? CP_FSCK_FLAG: CP_UMOUNT_FLAG; > + u32 flags = c.alloc_failed ? CP_FSCK_FLAG : > + (c.roll_forward ? 0 : CP_UMOUNT_FLAG); > block_t orphan_blks = 0; > block_t cp_blocks; > u32 i; > diff --git a/fsck/mount.c b/fsck/mount.c > index 3b02d73..805671c 100644 > --- a/fsck/mount.c > +++ b/fsck/mount.c > @@ -3218,7 +3218,7 @@ void write_checkpoint(struct f2fs_sb_info *sbi) > struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi); > block_t orphan_blks = 0; > unsigned long long cp_blk_no; > - u32 flags = CP_UMOUNT_FLAG; > + u32 flags = c.roll_forward ? 0 : CP_UMOUNT_FLAG; > int i, ret; > uint32_t crc = 0; > > @@ -3837,6 +3837,9 @@ static int record_fsync_data(struct f2fs_sb_info *sbi) > if (ret) > goto out; > > + if (c.func == FSCK && inode_list.next != &inode_list) > + c.roll_forward = 1; > + > ret = late_build_segment_manager(sbi); > if (ret < 0) { > ERR_MSG("late_build_segment_manager failed\n"); > diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h > index abd5abf..faa5d6b 100644 > --- a/include/f2fs_fs.h > +++ b/include/f2fs_fs.h > @@ -1513,6 +1513,7 @@ struct f2fs_configuration { > unsigned int feature; /* defined features */ > unsigned int quota_bits; /* quota bits */ > time_t fixed_time; > + int roll_forward; > > /* mkfs parameters */ > int fake_seed; _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs-tools: do not put CP_UMOUNT_FLAG for roll forward recovery @ 2023-11-15 14:56 ` Chao Yu 0 siblings, 0 replies; 2+ messages in thread From: Chao Yu @ 2023-11-15 14:56 UTC (permalink / raw) To: Daeho Jeong, linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong On 2023/10/27 23:49, Daeho Jeong wrote: > From: Daeho Jeong <daehojeong@google.com> > > If we write CP_UMOUNT_FLAG in fsck, f2fs will not do foll forward recovery :s/foll/roll Otherwise, it looks good to me. Reviewed-by: Chao Yu <chao@kernel.org> Thanks, > even though it has to do. > > Signed-off-by: Daeho Jeong <daehojeong@google.com> > --- > fsck/fsck.c | 3 ++- > fsck/mount.c | 5 ++++- > include/f2fs_fs.h | 1 + > 3 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/fsck/fsck.c b/fsck/fsck.c > index f1a55db..126458c 100644 > --- a/fsck/fsck.c > +++ b/fsck/fsck.c > @@ -2526,7 +2526,8 @@ static void fix_checkpoint(struct f2fs_sb_info *sbi) > struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi); > struct f2fs_checkpoint *cp = F2FS_CKPT(sbi); > unsigned long long cp_blk_no; > - u32 flags = c.alloc_failed ? CP_FSCK_FLAG: CP_UMOUNT_FLAG; > + u32 flags = c.alloc_failed ? CP_FSCK_FLAG : > + (c.roll_forward ? 0 : CP_UMOUNT_FLAG); > block_t orphan_blks = 0; > block_t cp_blocks; > u32 i; > diff --git a/fsck/mount.c b/fsck/mount.c > index 3b02d73..805671c 100644 > --- a/fsck/mount.c > +++ b/fsck/mount.c > @@ -3218,7 +3218,7 @@ void write_checkpoint(struct f2fs_sb_info *sbi) > struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi); > block_t orphan_blks = 0; > unsigned long long cp_blk_no; > - u32 flags = CP_UMOUNT_FLAG; > + u32 flags = c.roll_forward ? 0 : CP_UMOUNT_FLAG; > int i, ret; > uint32_t crc = 0; > > @@ -3837,6 +3837,9 @@ static int record_fsync_data(struct f2fs_sb_info *sbi) > if (ret) > goto out; > > + if (c.func == FSCK && inode_list.next != &inode_list) > + c.roll_forward = 1; > + > ret = late_build_segment_manager(sbi); > if (ret < 0) { > ERR_MSG("late_build_segment_manager failed\n"); > diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h > index abd5abf..faa5d6b 100644 > --- a/include/f2fs_fs.h > +++ b/include/f2fs_fs.h > @@ -1513,6 +1513,7 @@ struct f2fs_configuration { > unsigned int feature; /* defined features */ > unsigned int quota_bits; /* quota bits */ > time_t fixed_time; > + int roll_forward; > > /* mkfs parameters */ > int fake_seed; ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-15 14:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231027154935.1384979-1-daeho43@gmail.com>
2023-11-15 14:56 ` [f2fs-dev] [PATCH] f2fs-tools: do not put CP_UMOUNT_FLAG for roll forward recovery Chao Yu
2023-11-15 14:56 ` Chao Yu
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.