Skip to content

Commit 76da333

Browse files
Sheng YongJaegeuk Kim
authored andcommitted
f2fs: alloc new section if curseg is not the first seg in its zone
If curseg is not the first segment in its zone, the zone is not empty. A new section should be allocated and avoid resetting the old zone. Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Sheng Yong <shengyong@oppo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent cc260b6 commit 76da333

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/f2fs/segment.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5187,7 +5187,8 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type)
51875187
}
51885188

51895189
/* Allocate a new section if it's not new. */
5190-
if (cs->next_blkoff) {
5190+
if (cs->next_blkoff ||
5191+
cs->segno != GET_SEG_FROM_SEC(sbi, GET_ZONE_FROM_SEC(sbi, cs_section))) {
51915192
unsigned int old_segno = cs->segno, old_blkoff = cs->next_blkoff;
51925193

51935194
f2fs_allocate_new_section(sbi, type, true);

0 commit comments

Comments
 (0)