]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up queue-6.1/btrfs-do-not-bug_on-on-tree-mod-log-failure-at-balan.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jul 2023 15:10:35 +0000 (17:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jul 2023 15:10:35 +0000 (17:10 +0200)
queue-6.1/btrfs-do-not-bug_on-on-tree-mod-log-failure-at-balan.patch
queue-6.1/btrfs-fix-extent-buffer-leak-after-tree-mod-log-failure-at-split_node.patch

index 0e859645bf4e1a74dcfd5cdb8150467160daf194..94def81194f7509452e7a9d4999aa0195eeb25a7 100644 (file)
@@ -1,4 +1,4 @@
-From 8ed10e3be3d7f6905f1a98b67b823e83668664e3 Mon Sep 17 00:00:00 2001
+From 0d68eefaee4ab5908c73b86de4a9ec369ea322d4 Mon Sep 17 00:00:00 2001
 From: Sasha Levin <sashal@kernel.org>
 Date: Thu, 8 Jun 2023 11:27:41 +0100
 Subject: btrfs: do not BUG_ON() on tree mod log failure at balance_level()
@@ -22,14 +22,12 @@ Reviewed-by: David Sterba <dsterba@suse.com>
 Signed-off-by: David Sterba <dsterba@suse.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- fs/btrfs/ctree.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
+ fs/btrfs/ctree.c |   17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
 
-diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
-index ab9f8d6c4f1b9..1cd6ce6aafb00 100644
 --- a/fs/btrfs/ctree.c
 +++ b/fs/btrfs/ctree.c
-@@ -935,7 +935,12 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
+@@ -935,7 +935,12 @@ static noinline int balance_level(struct
                }
  
                ret = btrfs_tree_mod_log_insert_root(root->node, child, true);
@@ -43,7 +41,7 @@ index ab9f8d6c4f1b9..1cd6ce6aafb00 100644
                rcu_assign_pointer(root->node, child);
  
                add_root_to_dirty_list(root);
-@@ -1017,7 +1022,10 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
+@@ -1017,7 +1022,10 @@ static noinline int balance_level(struct
                        btrfs_node_key(right, &right_key, 0);
                        ret = btrfs_tree_mod_log_insert_key(parent, pslot + 1,
                                        BTRFS_MOD_LOG_KEY_REPLACE, GFP_NOFS);
@@ -55,10 +53,11 @@ index ab9f8d6c4f1b9..1cd6ce6aafb00 100644
                        btrfs_set_node_key(parent, &right_key, pslot + 1);
                        btrfs_mark_buffer_dirty(parent);
                }
-@@ -1064,6 +1072,10 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
+@@ -1063,7 +1071,10 @@ static noinline int balance_level(struct
+               btrfs_node_key(mid, &mid_key, 0);
                ret = btrfs_tree_mod_log_insert_key(parent, pslot,
                                BTRFS_MOD_LOG_KEY_REPLACE, GFP_NOFS);
-               BUG_ON(ret < 0);
+-              BUG_ON(ret < 0);
 +              if (ret < 0) {
 +                      btrfs_abort_transaction(trans, ret);
 +                      goto enospc;
@@ -66,6 +65,3 @@ index ab9f8d6c4f1b9..1cd6ce6aafb00 100644
                btrfs_set_node_key(parent, &mid_key, pslot);
                btrfs_mark_buffer_dirty(parent);
        }
--- 
-2.39.2
-
index bdfb12261c486e91ffeb77f25d71096e1887d4d7..63e6220a7b16056dbac4a10e83828cf3ced2612a 100644 (file)
@@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/fs/btrfs/ctree.c
 +++ b/fs/btrfs/ctree.c
-@@ -2862,6 +2862,8 @@ static noinline int split_node(struct bt
+@@ -2861,6 +2861,8 @@ static noinline int split_node(struct bt
  
        ret = btrfs_tree_mod_log_eb_copy(split, c, 0, mid, c_nritems - mid);
        if (ret) {