f2fs: fix error handling of __get_node_page
authorZhiguo Niu <zhiguo.niu@unisoc.com>
Wed, 18 Oct 2023 06:51:02 +0000 (14:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:07:01 +0000 (17:07 +0000)
[ Upstream commit 9b4c8dd99fe48721410741651d426015e03a4b7a ]

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>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/node.c

index a010b4b..b73d44d 100644 (file)
@@ -1455,7 +1455,8 @@ page_hit:
                          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: