From: Greg Kroah-Hartman Date: Wed, 13 Oct 2021 14:09:51 +0000 (+0200) Subject: drop ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch from everywhere X-Git-Tag: v4.4.289~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab43679a3fd105d6a1701ab6d630cda538774954;p=thirdparty%2Fkernel%2Fstable-queue.git drop ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch from everywhere --- diff --git a/queue-5.10/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch b/queue-5.10/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch deleted file mode 100644 index b719cdad04e..00000000000 --- a/queue-5.10/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 38c3015b3b8b3a977ca7fa0da8de65c9d8cab2d2 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 19 Aug 2021 10:49:27 -0400 -Subject: ext4: enforce buffer head state assertion in ext4_da_map_blocks - -From: Eric Whitney - -[ Upstream commit 948ca5f30e1df0c11eb5b0f410b9ceb97fa77ad9 ] - -Remove the code that re-initializes a buffer head with an invalid block -number and BH_New and BH_Delay bits when a matching delayed and -unwritten block has been found in the extent status cache. Replace it -with assertions that verify the buffer head already has this state -correctly set. The current code masked an inline data truncation bug -that left stale entries in the extent status cache. With this change, -generic/130 can be used to reproduce and detect that bug. - -Signed-off-by: Eric Whitney -Signed-off-by: Theodore Ts'o -Link: https://lore.kernel.org/r/20210819144927.25163-3-enwlinux@gmail.com -Signed-off-by: Theodore Ts'o -Signed-off-by: Sasha Levin ---- - fs/ext4/inode.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c -index 317aa1b90fb9..fce4fccb8641 100644 ---- a/fs/ext4/inode.c -+++ b/fs/ext4/inode.c -@@ -1727,13 +1727,16 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock, - } - - /* -- * Delayed extent could be allocated by fallocate. -- * So we need to check it. -+ * the buffer head associated with a delayed and not unwritten -+ * block found in the extent status cache must contain an -+ * invalid block number and have its BH_New and BH_Delay bits -+ * set, reflecting the state assigned when the block was -+ * initially delayed allocated - */ -- if (ext4_es_is_delayed(&es) && !ext4_es_is_unwritten(&es)) { -- map_bh(bh, inode->i_sb, invalid_block); -- set_buffer_new(bh); -- set_buffer_delay(bh); -+ if (ext4_es_is_delonly(&es)) { -+ BUG_ON(bh->b_blocknr != invalid_block); -+ BUG_ON(!buffer_new(bh)); -+ BUG_ON(!buffer_delay(bh)); - return 0; - } - --- -2.33.0 - diff --git a/queue-5.10/series b/queue-5.10/series index 22114cd2135..e306ebb0c65 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -1,7 +1,6 @@ ext4-check-and-update-i_disksize-properly.patch ext4-correct-the-error-path-of-ext4_write_inline_dat.patch asoc-intel-sof_sdw-tag-soundwire-bes-as-non-atomic.patch -ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch hid-apple-fix-logical-maximum-and-usage-maximum-of-m.patch netfilter-ip6_tables-zero-initialize-fragment-offset.patch hid-wacom-add-new-intuos-bt-ctl-4100wl-ctl-6100wl-de.patch diff --git a/queue-5.14/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch b/queue-5.14/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch deleted file mode 100644 index 5801065e57c..00000000000 --- a/queue-5.14/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch +++ /dev/null @@ -1,56 +0,0 @@ -From b2838e02c515366e8452370fcda5baa2dcc8be68 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 19 Aug 2021 10:49:27 -0400 -Subject: ext4: enforce buffer head state assertion in ext4_da_map_blocks - -From: Eric Whitney - -[ Upstream commit 948ca5f30e1df0c11eb5b0f410b9ceb97fa77ad9 ] - -Remove the code that re-initializes a buffer head with an invalid block -number and BH_New and BH_Delay bits when a matching delayed and -unwritten block has been found in the extent status cache. Replace it -with assertions that verify the buffer head already has this state -correctly set. The current code masked an inline data truncation bug -that left stale entries in the extent status cache. With this change, -generic/130 can be used to reproduce and detect that bug. - -Signed-off-by: Eric Whitney -Signed-off-by: Theodore Ts'o -Link: https://lore.kernel.org/r/20210819144927.25163-3-enwlinux@gmail.com -Signed-off-by: Theodore Ts'o -Signed-off-by: Sasha Levin ---- - fs/ext4/inode.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c -index fc6ea56de77c..d204688b32a3 100644 ---- a/fs/ext4/inode.c -+++ b/fs/ext4/inode.c -@@ -1726,13 +1726,16 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock, - } - - /* -- * Delayed extent could be allocated by fallocate. -- * So we need to check it. -+ * the buffer head associated with a delayed and not unwritten -+ * block found in the extent status cache must contain an -+ * invalid block number and have its BH_New and BH_Delay bits -+ * set, reflecting the state assigned when the block was -+ * initially delayed allocated - */ -- if (ext4_es_is_delayed(&es) && !ext4_es_is_unwritten(&es)) { -- map_bh(bh, inode->i_sb, invalid_block); -- set_buffer_new(bh); -- set_buffer_delay(bh); -+ if (ext4_es_is_delonly(&es)) { -+ BUG_ON(bh->b_blocknr != invalid_block); -+ BUG_ON(!buffer_new(bh)); -+ BUG_ON(!buffer_delay(bh)); - return 0; - } - --- -2.33.0 - diff --git a/queue-5.14/series b/queue-5.14/series index 79de9d7e6d3..cb7fcc5f204 100644 --- a/queue-5.14/series +++ b/queue-5.14/series @@ -1,7 +1,6 @@ ext4-check-and-update-i_disksize-properly.patch ext4-correct-the-error-path-of-ext4_write_inline_dat.patch asoc-intel-sof_sdw-tag-soundwire-bes-as-non-atomic.patch -ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch alsa-oxfw-fix-transmission-method-for-loud-models-ba.patch interconnect-qcom-sdm660-add-missing-a2noc-qos-clock.patch alsa-usb-audio-unify-mixer-resume-and-reset_resume-p.patch diff --git a/queue-5.4/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch b/queue-5.4/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch deleted file mode 100644 index 1f9485430bb..00000000000 --- a/queue-5.4/ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch +++ /dev/null @@ -1,56 +0,0 @@ -From dd19180ca7482668952b8c51499e0676f825189b Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 19 Aug 2021 10:49:27 -0400 -Subject: ext4: enforce buffer head state assertion in ext4_da_map_blocks - -From: Eric Whitney - -[ Upstream commit 948ca5f30e1df0c11eb5b0f410b9ceb97fa77ad9 ] - -Remove the code that re-initializes a buffer head with an invalid block -number and BH_New and BH_Delay bits when a matching delayed and -unwritten block has been found in the extent status cache. Replace it -with assertions that verify the buffer head already has this state -correctly set. The current code masked an inline data truncation bug -that left stale entries in the extent status cache. With this change, -generic/130 can be used to reproduce and detect that bug. - -Signed-off-by: Eric Whitney -Signed-off-by: Theodore Ts'o -Link: https://lore.kernel.org/r/20210819144927.25163-3-enwlinux@gmail.com -Signed-off-by: Theodore Ts'o -Signed-off-by: Sasha Levin ---- - fs/ext4/inode.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c -index dcbd8ac8d471..af594b5e4f9f 100644 ---- a/fs/ext4/inode.c -+++ b/fs/ext4/inode.c -@@ -1869,13 +1869,16 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock, - } - - /* -- * Delayed extent could be allocated by fallocate. -- * So we need to check it. -+ * the buffer head associated with a delayed and not unwritten -+ * block found in the extent status cache must contain an -+ * invalid block number and have its BH_New and BH_Delay bits -+ * set, reflecting the state assigned when the block was -+ * initially delayed allocated - */ -- if (ext4_es_is_delayed(&es) && !ext4_es_is_unwritten(&es)) { -- map_bh(bh, inode->i_sb, invalid_block); -- set_buffer_new(bh); -- set_buffer_delay(bh); -+ if (ext4_es_is_delonly(&es)) { -+ BUG_ON(bh->b_blocknr != invalid_block); -+ BUG_ON(!buffer_new(bh)); -+ BUG_ON(!buffer_delay(bh)); - return 0; - } - --- -2.33.0 - diff --git a/queue-5.4/series b/queue-5.4/series index 0ce6dcf2321..80df04211ef 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -1,6 +1,5 @@ net-phy-bcm7xxx-fixed-indirect-mmd-operations.patch ext4-correct-the-error-path-of-ext4_write_inline_dat.patch -ext4-enforce-buffer-head-state-assertion-in-ext4_da_.patch hid-apple-fix-logical-maximum-and-usage-maximum-of-m.patch netfilter-ip6_tables-zero-initialize-fragment-offset.patch hid-wacom-add-new-intuos-bt-ctl-4100wl-ctl-6100wl-de.patch