move_curseg_info->reset_curseg changes cursegs, however, new segment
entries are not set as dirty. As a result, flush_sit_entries will not
update entries in SIT, especially when an empty segment is selected
as the new curseg, its seg_entry->type is lost.

Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
 fsck/mount.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fsck/mount.c b/fsck/mount.c
index 0a30adb..68278c5 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -1149,6 +1149,7 @@ void reset_curseg(struct f2fs_sb_info *sbi, int type)
                SET_SUM_TYPE(sum_footer, SUM_TYPE_NODE);
        se = get_seg_entry(sbi, curseg->segno);
        se->type = type;
+       se->dirty = 1;
 }
 
 static void read_compacted_summaries(struct f2fs_sb_info *sbi)
-- 
2.17.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to