]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Apr 2025 09:09:58 +0000 (11:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Apr 2025 09:09:58 +0000 (11:09 +0200)
added patches:
btrfs-handle-errors-from-btrfs_dec_ref-properly.patch

queue-5.15/btrfs-handle-errors-from-btrfs_dec_ref-properly.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/btrfs-handle-errors-from-btrfs_dec_ref-properly.patch b/queue-5.15/btrfs-handle-errors-from-btrfs_dec_ref-properly.patch
new file mode 100644 (file)
index 0000000..19f8ac1
--- /dev/null
@@ -0,0 +1,36 @@
+From 5eb178f373b4f16f3b42d55ff88fc94dd95b93b1 Mon Sep 17 00:00:00 2001
+From: Josef Bacik <josef@toxicpanda.com>
+Date: Tue, 7 May 2024 14:12:15 -0400
+Subject: btrfs: handle errors from btrfs_dec_ref() properly
+
+From: Josef Bacik <josef@toxicpanda.com>
+
+commit 5eb178f373b4f16f3b42d55ff88fc94dd95b93b1 upstream.
+
+In walk_up_proc() we BUG_ON(ret) from btrfs_dec_ref().  This is
+incorrect, we have proper error handling here, return the error.
+
+Signed-off-by: Josef Bacik <josef@toxicpanda.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Jianqi Ren <jianqi.ren.cn@windriver.com>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/extent-tree.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/fs/btrfs/extent-tree.c
++++ b/fs/btrfs/extent-tree.c
+@@ -5461,7 +5461,10 @@ static noinline int walk_up_proc(struct
+                               ret = btrfs_dec_ref(trans, root, eb, 1);
+                       else
+                               ret = btrfs_dec_ref(trans, root, eb, 0);
+-                      BUG_ON(ret); /* -ENOMEM */
++                      if (ret) {
++                              btrfs_abort_transaction(trans, ret);
++                              return ret;
++                      }
+                       if (is_fstree(root->root_key.objectid)) {
+                               ret = btrfs_qgroup_trace_leaf_items(trans, eb);
+                               if (ret) {
index 94a4d282469f60fc7ed0bc923beb0c6afe65c7d0..f21e1adc7683eb5b87701ec6cd86073933579451 100644 (file)
@@ -259,3 +259,4 @@ drm-amd-display-skip-inactive-planes-within-modesupportandsystemconfiguration.pa
 usbnet-fix-npe-during-rx_complete.patch
 platform-x86-isst-correct-command-storage-data-length.patch
 ntb_perf-delete-duplicate-dmaengine_unmap_put-call-in-perf_copy_chunk.patch
+btrfs-handle-errors-from-btrfs_dec_ref-properly.patch