Commit 76da333f authored by Sheng Yong's avatar Sheng Yong Committed by Jaegeuk Kim
Browse files

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: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarSheng Yong <shengyong@oppo.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent cc260b66
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5187,7 +5187,8 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type)
	}

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

		f2fs_allocate_new_section(sbi, type, true);