summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhiguo Niu <zhiguo.niu@unisoc.com>2023-10-18 09:51:02 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-28 20:19:45 +0300
commitb7b01c7804775cb3586fed3c71bc8c38fcc77000 (patch)
tree33769b7421c47933b04f9f82dafad8ea2a27752d
parent0237975d8e3ec10c07b8169e22a6cea35afd8475 (diff)
downloadlinux-b7b01c7804775cb3586fed3c71bc8c38fcc77000.tar.xz
f2fs: fix error handling of __get_node_page
[ 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>
-rw-r--r--fs/f2fs/node.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 248764badcde..ed963c56ac32 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1467,7 +1467,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: