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

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

diff --git a/queue-5.10/btrfs-handle-errors-from-btrfs_dec_ref-properly.patch b/queue-5.10/btrfs-handle-errors-from-btrfs_dec_ref-properly.patch
new file mode 100644 (file)
index 0000000..f50f432
--- /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
+@@ -5240,7 +5240,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 a732ecd4d7545ab051dd7b14e2a4424726ed1dae..0bffc50e88b90fa7c3d5151262ec7659a035fd94 100644 (file)
@@ -209,3 +209,4 @@ tty-serial-fsl_lpuart-disable-transmitter-before-cha.patch
 drm-amd-pm-fix-negative-array-index-read.patch
 drm-amd-display-skip-inactive-planes-within-modesupportandsystemconfiguration.patch
 ntb_perf-delete-duplicate-dmaengine_unmap_put-call-in-perf_copy_chunk.patch
+btrfs-handle-errors-from-btrfs_dec_ref-properly.patch