From: Greg Kroah-Hartman Date: Wed, 21 Feb 2024 15:47:51 +0000 (+0100) Subject: drop nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch X-Git-Tag: v4.19.307~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2ff29b1d29472103fe0a26a6a3c573c66b2094a;p=thirdparty%2Fkernel%2Fstable-queue.git drop nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch from 4.19 and 5.4 --- diff --git a/queue-4.19/nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch b/queue-4.19/nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch deleted file mode 100644 index e458904fc52..00000000000 --- a/queue-4.19/nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 5124a0a549857c4b87173280e192eea24dea72ad Mon Sep 17 00:00:00 2001 -From: Ryusuke Konishi -Date: Fri, 27 Jan 2023 01:41:14 +0900 -Subject: nilfs2: replace WARN_ONs for invalid DAT metadata block requests - -From: Ryusuke Konishi - -commit 5124a0a549857c4b87173280e192eea24dea72ad upstream. - -If DAT metadata file block access fails due to corruption of the DAT file -or abnormal virtual block numbers held by b-trees or inodes, a kernel -warning is generated. - -This replaces the WARN_ONs by error output, so that a kernel, booted with -panic_on_warn, does not panic. This patch also replaces the detected -return code -ENOENT with another internal code -EINVAL to notify the bmap -layer of metadata corruption. When the bmap layer sees -EINVAL, it -handles the abnormal situation with nilfs_bmap_convert_error() and finally -returns code -EIO as it should. - -Link: https://lkml.kernel.org/r/0000000000005cc3d205ea23ddcf@google.com -Link: https://lkml.kernel.org/r/20230126164114.6911-1-konishi.ryusuke@gmail.com -Signed-off-by: Ryusuke Konishi -Reported-by: -Tested-by: Ryusuke Konishi -Signed-off-by: Andrew Morton -Signed-off-by: Greg Kroah-Hartman ---- - fs/nilfs2/dat.c | 27 +++++++++++++++++---------- - 1 file changed, 17 insertions(+), 10 deletions(-) - ---- a/fs/nilfs2/dat.c -+++ b/fs/nilfs2/dat.c -@@ -40,8 +40,21 @@ static inline struct nilfs_dat_info *NIL - static int nilfs_dat_prepare_entry(struct inode *dat, - struct nilfs_palloc_req *req, int create) - { -- return nilfs_palloc_get_entry_block(dat, req->pr_entry_nr, -- create, &req->pr_entry_bh); -+ int ret; -+ -+ ret = nilfs_palloc_get_entry_block(dat, req->pr_entry_nr, -+ create, &req->pr_entry_bh); -+ if (unlikely(ret == -ENOENT)) { -+ nilfs_error(dat->i_sb, -+ "DAT doesn't have a block to manage vblocknr = %llu", -+ (unsigned long long)req->pr_entry_nr); -+ /* -+ * Return internal code -EINVAL to notify bmap layer of -+ * metadata corruption. -+ */ -+ ret = -EINVAL; -+ } -+ return ret; - } - - static void nilfs_dat_commit_entry(struct inode *dat, -@@ -123,11 +136,7 @@ static void nilfs_dat_commit_free(struct - - int nilfs_dat_prepare_start(struct inode *dat, struct nilfs_palloc_req *req) - { -- int ret; -- -- ret = nilfs_dat_prepare_entry(dat, req, 0); -- WARN_ON(ret == -ENOENT); -- return ret; -+ return nilfs_dat_prepare_entry(dat, req, 0); - } - - void nilfs_dat_commit_start(struct inode *dat, struct nilfs_palloc_req *req, -@@ -154,10 +163,8 @@ int nilfs_dat_prepare_end(struct inode * - int ret; - - ret = nilfs_dat_prepare_entry(dat, req, 0); -- if (ret < 0) { -- WARN_ON(ret == -ENOENT); -+ if (ret < 0) - return ret; -- } - - kaddr = kmap_atomic(req->pr_entry_bh->b_page); - entry = nilfs_palloc_block_get_entry(dat, req->pr_entry_nr, diff --git a/queue-4.19/series b/queue-4.19/series index 90dde3dacb5..e45f650066f 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -197,6 +197,5 @@ pmdomain-core-move-the-unused-cleanup-to-a-_sync-initcall.patch revert-md-raid5-wait-for-md_sb_change_pending-in-rai.patch sched-membarrier-reduce-the-ability-to-hammer-on-sys_membarrier.patch nilfs2-fix-potential-bug-in-end_buffer_async_write.patch -nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch lsm-new-security_file_ioctl_compat-hook.patch netfilter-nf_tables-fix-pointer-math-issue-in-nft_byteorder_eval.patch diff --git a/queue-5.4/nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch b/queue-5.4/nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch deleted file mode 100644 index e458904fc52..00000000000 --- a/queue-5.4/nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 5124a0a549857c4b87173280e192eea24dea72ad Mon Sep 17 00:00:00 2001 -From: Ryusuke Konishi -Date: Fri, 27 Jan 2023 01:41:14 +0900 -Subject: nilfs2: replace WARN_ONs for invalid DAT metadata block requests - -From: Ryusuke Konishi - -commit 5124a0a549857c4b87173280e192eea24dea72ad upstream. - -If DAT metadata file block access fails due to corruption of the DAT file -or abnormal virtual block numbers held by b-trees or inodes, a kernel -warning is generated. - -This replaces the WARN_ONs by error output, so that a kernel, booted with -panic_on_warn, does not panic. This patch also replaces the detected -return code -ENOENT with another internal code -EINVAL to notify the bmap -layer of metadata corruption. When the bmap layer sees -EINVAL, it -handles the abnormal situation with nilfs_bmap_convert_error() and finally -returns code -EIO as it should. - -Link: https://lkml.kernel.org/r/0000000000005cc3d205ea23ddcf@google.com -Link: https://lkml.kernel.org/r/20230126164114.6911-1-konishi.ryusuke@gmail.com -Signed-off-by: Ryusuke Konishi -Reported-by: -Tested-by: Ryusuke Konishi -Signed-off-by: Andrew Morton -Signed-off-by: Greg Kroah-Hartman ---- - fs/nilfs2/dat.c | 27 +++++++++++++++++---------- - 1 file changed, 17 insertions(+), 10 deletions(-) - ---- a/fs/nilfs2/dat.c -+++ b/fs/nilfs2/dat.c -@@ -40,8 +40,21 @@ static inline struct nilfs_dat_info *NIL - static int nilfs_dat_prepare_entry(struct inode *dat, - struct nilfs_palloc_req *req, int create) - { -- return nilfs_palloc_get_entry_block(dat, req->pr_entry_nr, -- create, &req->pr_entry_bh); -+ int ret; -+ -+ ret = nilfs_palloc_get_entry_block(dat, req->pr_entry_nr, -+ create, &req->pr_entry_bh); -+ if (unlikely(ret == -ENOENT)) { -+ nilfs_error(dat->i_sb, -+ "DAT doesn't have a block to manage vblocknr = %llu", -+ (unsigned long long)req->pr_entry_nr); -+ /* -+ * Return internal code -EINVAL to notify bmap layer of -+ * metadata corruption. -+ */ -+ ret = -EINVAL; -+ } -+ return ret; - } - - static void nilfs_dat_commit_entry(struct inode *dat, -@@ -123,11 +136,7 @@ static void nilfs_dat_commit_free(struct - - int nilfs_dat_prepare_start(struct inode *dat, struct nilfs_palloc_req *req) - { -- int ret; -- -- ret = nilfs_dat_prepare_entry(dat, req, 0); -- WARN_ON(ret == -ENOENT); -- return ret; -+ return nilfs_dat_prepare_entry(dat, req, 0); - } - - void nilfs_dat_commit_start(struct inode *dat, struct nilfs_palloc_req *req, -@@ -154,10 +163,8 @@ int nilfs_dat_prepare_end(struct inode * - int ret; - - ret = nilfs_dat_prepare_entry(dat, req, 0); -- if (ret < 0) { -- WARN_ON(ret == -ENOENT); -+ if (ret < 0) - return ret; -- } - - kaddr = kmap_atomic(req->pr_entry_bh->b_page); - entry = nilfs_palloc_block_get_entry(dat, req->pr_entry_nr, diff --git a/queue-5.4/series b/queue-5.4/series index eeb86112526..40ce1c0d01e 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -255,7 +255,6 @@ netfilter-ipset-missing-gc-cancellations-fixed.patch net-prevent-mss-overflow-in-skb_segment.patch sched-membarrier-reduce-the-ability-to-hammer-on-sys_membarrier.patch nilfs2-fix-potential-bug-in-end_buffer_async_write.patch -nilfs2-replace-warn_ons-for-invalid-dat-metadata-block-requests.patch pm-runtime-add-devm_pm_runtime_enable-helper.patch pm-runtime-have-devm_pm_runtime_enable-handle-pm_runtime_dont_use_autosuspend.patch drm-msm-dsi-enable-runtime-pm.patch