f2fs: fix false alarm on invalid block address
Jaegeuk Kim
maintainerPATCH 1/1 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: <[email protected]> # v6.9+
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770
--- fs/f2fs/checkpoint.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
fs/f2fs/checkpoint.c +5 -4
@@ -179,22 +179,22 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,break ;case META_SIT :if (unlikely (blkaddr >=SIT_BLK_CNT (sbi))) - goto err; + goto check_only;break ;case META_SSA :if (unlikely (blkaddr >=MAIN_BLKADDR (sbi) || blkaddr <SM_I (sbi)->ssa_blkaddr)) - goto err; + goto check_only;break ;case META_CP :if (unlikely (blkaddr >=SIT_I (sbi)->sit_base_addr || blkaddr <__start_cp_addr (sbi))) - goto err; + goto check_only;break ;case META_POR :if (unlikely (blkaddr >=MAX_BLKADDR (sbi) || blkaddr <MAIN_BLKADDR (sbi))) - goto err; + goto check_only;break ;case DATA_GENERIC :case DATA_GENERIC_ENHANCE :
@@ -228,6 +228,7 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,return true; err:f2fs_handle_error (sbi,ERROR_INVALID_BLKADDR ); +check_only:return false; }
Signature · 1 line
2.44.0.769.g3c40516874-goog
Quoted 7 lines · Jaegeuk Kim
f2fs_ra_meta_pagescan try to read ahead on invalid block address which is not the corruption case.Cc: <[email protected]> # v6.9+
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770Fixes 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr")Signed-off-by Jaegeuk Kim <[email protected]>
Thanks,
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:
Quoted 9 lines · On Wed, 24 Apr 2024 17:35:48 +0000 you wrote:
f2fs_ra_meta_pagescan try to read ahead on invalid block address which is not the corruption case.Cc: <[email protected]> # v6.9+
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770Fixes 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr")Signed-off-by Jaegeuk Kim <[email protected]>[...]
Here is the summary with links:
- [f2fs-dev] f2fs: fix false alarm on invalid block address
https://git.kernel.org/jaegeuk/f2fs/c/b864ddb57eb0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html