From: Greg Kroah-Hartman Date: Sun, 16 Jul 2023 15:10:35 +0000 (+0200) Subject: fix up queue-6.1/btrfs-do-not-bug_on-on-tree-mod-log-failure-at-balan.patch X-Git-Tag: v6.1.39~57 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d65b1424a2e94c15d76f370bdf5074bcb5fa115;p=thirdparty%2Fkernel%2Fstable-queue.git fix up queue-6.1/btrfs-do-not-bug_on-on-tree-mod-log-failure-at-balan.patch --- diff --git a/queue-6.1/btrfs-do-not-bug_on-on-tree-mod-log-failure-at-balan.patch b/queue-6.1/btrfs-do-not-bug_on-on-tree-mod-log-failure-at-balan.patch index 0e859645bf4..94def81194f 100644 --- a/queue-6.1/btrfs-do-not-bug_on-on-tree-mod-log-failure-at-balan.patch +++ b/queue-6.1/btrfs-do-not-bug_on-on-tree-mod-log-failure-at-balan.patch @@ -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 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 Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- - 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 - diff --git a/queue-6.1/btrfs-fix-extent-buffer-leak-after-tree-mod-log-failure-at-split_node.patch b/queue-6.1/btrfs-fix-extent-buffer-leak-after-tree-mod-log-failure-at-split_node.patch index bdfb12261c4..63e6220a7b1 100644 --- a/queue-6.1/btrfs-fix-extent-buffer-leak-after-tree-mod-log-failure-at-split_node.patch +++ b/queue-6.1/btrfs-fix-extent-buffer-leak-after-tree-mod-log-failure-at-split_node.patch @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman --- 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) {