f2fs: fix error handling of __get_node_page

Message ID 1697611862-25239-1-git-send-email-zhiguo.niu@unisoc.com
State New
Headers
Series f2fs: fix error handling of __get_node_page |

Commit Message

Zhiguo Niu Oct. 18, 2023, 6:51 a.m. UTC
  Use f2fs_handle_error to record inconsistent node block error
and return -EFSCORRUPTED instead of -EINVAL.

Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
---
 fs/f2fs/node.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

patchwork-bot+f2fs@kernel.org Oct. 23, 2023, 3:30 p.m. UTC | #1
Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Wed, 18 Oct 2023 14:51:02 +0800 you wrote:
> Use f2fs_handle_error to record inconsistent node block error
> and return -EFSCORRUPTED instead of -EINVAL.
> 
> Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> ---
>  fs/f2fs/node.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [f2fs-dev] f2fs: fix error handling of __get_node_page
    https://git.kernel.org/jaegeuk/f2fs/c/9b4c8dd99fe4

You are awesome, thank you!
  

Patch

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 248764b..ed963c56 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1467,7 +1467,8 @@  static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
 			  ofs_of_node(page), cpver_of_node(page),
 			  next_blkaddr_of_node(page));
 	set_sbi_flag(sbi, SBI_NEED_FSCK);
-	err = -EINVAL;
+	f2fs_handle_error(sbi, ERROR_INCONSISTENT_FOOTER);
+	err = -EFSCORRUPTED;
 out_err:
 	ClearPageUptodate(page);
 out_put_err: