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.6 14/18] f2fs: fix error handling of __get_node_page
Date: Tue, 7 Nov 2023 18:22:08 -0500 [thread overview]
Message-ID: <20231107232231.3775605-14-sashal@kernel.org> (raw)
In-Reply-To: <20231107232231.3775605-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 248764badcde8..ed963c56ac32a 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:
--
2.42.0
next prev parent reply other threads:[~2023-11-07 23:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 23:21 [PATCH AUTOSEL 6.6 01/18] iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() Sasha Levin
2023-11-07 23:21 ` [PATCH AUTOSEL 6.6 02/18] thunderbolt: Apply USB 3.x bandwidth quirk only in software connection manager Sasha Levin
2023-11-07 23:21 ` [PATCH AUTOSEL 6.6 03/18] tty: vcc: Add check for kstrdup() in vcc_probe() Sasha Levin
2023-11-07 23:21 ` [PATCH AUTOSEL 6.6 04/18] dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides Sasha Levin
2023-11-07 23:21 ` [PATCH AUTOSEL 6.6 05/18] phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 06/18] phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 07/18] usb: dwc3: core: configure TX/RX threshold for DWC3_IP Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 08/18] usb: pci-quirks: group AMD specific quirk code together Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 09/18] usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 10/18] usb: pci-quirks: handle HAS_IOPORT dependency for UHCI handoff Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 11/18] usb: ucsi: glink: use the connector orientation GPIO to provide switch events Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 12/18] soundwire: dmi-quirks: update HP Omen match Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 13/18] f2fs: fix error path of __f2fs_build_free_nids Sasha Levin
2023-11-07 23:22 ` Sasha Levin [this message]
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 15/18] usb: host: xhci: Avoid XHCI resume delay if SSUSB device is not present Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 16/18] usb: gadget: f_ncm: Always set current gadget in ncm_bind() Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 17/18] 9p/trans_fd: Annotate data-racy writes to file::f_flags Sasha Levin
2023-11-07 23:22 ` [PATCH AUTOSEL 6.6 18/18] 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=20231107232231.3775605-14-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
Powered by JetHome