1.We use zero as upper boundary value for ra SSA/CP blocks, we will skip
readahead as verification failure with max number, it causes low performance.
2.Low boundary value is not accurate for SSA/CP/POR region verification, so
these values need to be redefined.
This patch fixes above issues.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
case META_SIT:
return SIT_BLK_CNT(sbi);
case META_SSA:
+ return MAIN_BLKADDR(sbi);
case META_CP:
- return 0;
+ return SM_I(sbi)->sit_info->sit_base_addr;
case META_POR:
return MAX_BLKADDR(sbi);
default:
prev_blk_addr = blk_addr;
break;
case META_SSA:
+ if (unlikely(blkno >= max_blks))
+ goto out;
+ if (unlikely(blkno < SM_I(sbi)->ssa_blkaddr))
+ goto out;
+ blk_addr = blkno;
+ break;
case META_CP:
+ if (unlikely(blkno >= max_blks))
+ goto out;
+ if (unlikely(blkno < __start_cp_addr(sbi)))
+ goto out;
+ blk_addr = blkno;
+ break;
case META_POR:
if (unlikely(blkno >= max_blks))
goto out;
- if (unlikely(blkno < SEG0_BLKADDR(sbi)))
+ if (unlikely(blkno < MAIN_BLKADDR(sbi)))
goto out;
blk_addr = blkno;
break;