Skip to content

Commit b864ddb

Browse files
author
Jaegeuk Kim
committed
f2fs: fix false alarm on invalid block address
f2fs_ra_meta_pages can try to read ahead on invalid block address which is not the corruption case. Cc: <stable@kernel.org> # v6.9+ Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770 Fixes: 31f85cc ("f2fs: unify the error handling of f2fs_is_valid_blkaddr") Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 2174035 commit b864ddb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

fs/f2fs/checkpoint.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,22 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
179179
break;
180180
case META_SIT:
181181
if (unlikely(blkaddr >= SIT_BLK_CNT(sbi)))
182-
goto err;
182+
goto check_only;
183183
break;
184184
case META_SSA:
185185
if (unlikely(blkaddr >= MAIN_BLKADDR(sbi) ||
186186
blkaddr < SM_I(sbi)->ssa_blkaddr))
187-
goto err;
187+
goto check_only;
188188
break;
189189
case META_CP:
190190
if (unlikely(blkaddr >= SIT_I(sbi)->sit_base_addr ||
191191
blkaddr < __start_cp_addr(sbi)))
192-
goto err;
192+
goto check_only;
193193
break;
194194
case META_POR:
195195
if (unlikely(blkaddr >= MAX_BLKADDR(sbi) ||
196196
blkaddr < MAIN_BLKADDR(sbi)))
197-
goto err;
197+
goto check_only;
198198
break;
199199
case DATA_GENERIC:
200200
case DATA_GENERIC_ENHANCE:
@@ -228,6 +228,7 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
228228
return true;
229229
err:
230230
f2fs_handle_error(sbi, ERROR_INVALID_BLKADDR);
231+
check_only:
231232
return false;
232233
}
233234

0 commit comments

Comments
 (0)