]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Nov 2021 14:12:12 +0000 (15:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Nov 2021 14:12:12 +0000 (15:12 +0100)
added patches:
btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch

queue-4.14/btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch b/queue-4.14/btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch
new file mode 100644 (file)
index 0000000..bc97da7
--- /dev/null
@@ -0,0 +1,37 @@
+From 10adb1152d957a4d570ad630f93a88bb961616c1 Mon Sep 17 00:00:00 2001
+From: Filipe Manana <fdmanana@suse.com>
+Date: Thu, 14 Oct 2021 17:26:04 +0100
+Subject: btrfs: fix lost error handling when replaying directory deletes
+
+From: Filipe Manana <fdmanana@suse.com>
+
+commit 10adb1152d957a4d570ad630f93a88bb961616c1 upstream.
+
+At replay_dir_deletes(), if find_dir_range() returns an error we break out
+of the main while loop and then assign a value of 0 (success) to the 'ret'
+variable, resulting in completely ignoring that an error happened. Fix
+that by jumping to the 'out' label when find_dir_range() returns an error
+(negative value).
+
+CC: stable@vger.kernel.org # 4.4+
+Reviewed-by: Josef Bacik <josef@toxicpanda.com>
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/tree-log.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/fs/btrfs/tree-log.c
++++ b/fs/btrfs/tree-log.c
+@@ -2286,7 +2286,9 @@ again:
+               else {
+                       ret = find_dir_range(log, path, dirid, key_type,
+                                            &range_start, &range_end);
+-                      if (ret != 0)
++                      if (ret < 0)
++                              goto out;
++                      else if (ret > 0)
+                               break;
+               }
index e6400960ea135d0f8469f52c17cf1197c362debb..91f67e4ea7e63365f889c983bde6bf1b8f5a4da8 100644 (file)
@@ -28,3 +28,4 @@ xen-netfront-stop-tx-queues-during-live-migration.patch
 spi-spl022-fix-microwire-full-duplex-mode.patch
 watchdog-fix-omap-watchdog-early-handling.patch
 vmxnet3-do-not-stop-tx-queues-after-netif_device_det.patch
+btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch