unsigned int end_segno = start_segno + SEGS_PER_SEC(sbi);
unsigned int sec_end_segno;
int seg_freed = 0, migrated = 0;
- unsigned char type = IS_DATASEG(get_seg_entry(sbi, segno)->type) ?
- SUM_TYPE_DATA : SUM_TYPE_NODE;
- unsigned char data_type = (type == SUM_TYPE_DATA) ? DATA : NODE;
+ unsigned char type;
+ unsigned char data_type;
int submitted = 0, sum_blk_cnt;
if (__is_large_section(sbi)) {
migrated >= sbi->migration_granularity)
continue;
+ if (migrated == 0) {
+ type = IS_DATASEG(get_seg_entry(sbi, cur_segno)->type) ?
+ SUM_TYPE_DATA : SUM_TYPE_NODE;
+ data_type = (type == SUM_TYPE_DATA) ? DATA : NODE;
+ }
+
sum = SUM_BLK_PAGE_ADDR(sbi, sum_folio, cur_segno);
if (type != GET_SUM_TYPE(sum_footer(sbi, sum))) {
f2fs_err(sbi, "Inconsistent segment (%u) type "