[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231107232420.3776419-8-sashal@kernel.org>
Date: Tue, 7 Nov 2023 18:24:09 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Zhiguo Niu <zhiguo.niu@...soc.com>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Sasha Levin <sashal@...nel.org>, chao@...nel.org,
linux-f2fs-devel@...ts.sourceforge.net
Subject: [PATCH AUTOSEL 6.1 08/11] f2fs: fix error handling of __get_node_page
From: Zhiguo Niu <zhiguo.niu@...soc.com>
[ 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@...soc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
fs/f2fs/node.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a010b4bc36d2c..b73d44df9423b 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1455,7 +1455,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:
--
2.42.0
Powered by blists - more mailing lists