From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Zhiguo Niu <zhiguo.niu@unisoc.com>,
Jaegeuk Kim <jaegeuk@kernel.org>, Sasha Levin <sashal@kernel.org>,
chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH AUTOSEL 6.1 08/11] f2fs: fix error handling of __get_node_page
Date: Tue, 7 Nov 2023 18:24:09 -0500 [thread overview]
Message-ID: <20231107232420.3776419-8-sashal@kernel.org> (raw)
In-Reply-To: <20231107232420.3776419-1-sashal@kernel.org>
From: Zhiguo Niu <zhiguo.niu@unisoc.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@unisoc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.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
next prev parent reply other threads:[~2023-11-07 23:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 23:24 [PATCH AUTOSEL 6.1 01/11] iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() Sasha Levin
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 02/11] thunderbolt: Apply USB 3.x bandwidth quirk only in software connection manager Sasha Levin
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 03/11] tty: vcc: Add check for kstrdup() in vcc_probe() Sasha Levin
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 04/11] usb: dwc3: core: configure TX/RX threshold for DWC3_IP Sasha Levin
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 05/11] usb: pci-quirks: group AMD specific quirk code together Sasha Levin
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 06/11] usb: pci-quirks: handle HAS_IOPORT dependency for UHCI handoff Sasha Levin
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 07/11] soundwire: dmi-quirks: update HP Omen match Sasha Levin
2023-11-07 23:24 ` Sasha Levin [this message]
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 09/11] usb: gadget: f_ncm: Always set current gadget in ncm_bind() Sasha Levin
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 10/11] 9p/trans_fd: Annotate data-racy writes to file::f_flags Sasha Levin
2023-11-07 23:24 ` [PATCH AUTOSEL 6.1 11/11] 9p: v9fs_listxattr: fix %s null argument warning Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231107232420.3776419-8-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=zhiguo.niu@unisoc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®