From: Greg Kroah-Hartman Date: Sat, 13 Nov 2021 14:11:33 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v5.4.160~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6380bf0a98a9e7459f96567aaa109ac2797520c;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch --- diff --git a/queue-4.4/btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch b/queue-4.4/btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch new file mode 100644 index 00000000000..b9ae0845403 --- /dev/null +++ b/queue-4.4/btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch @@ -0,0 +1,37 @@ +From 10adb1152d957a4d570ad630f93a88bb961616c1 Mon Sep 17 00:00:00 2001 +From: Filipe Manana +Date: Thu, 14 Oct 2021 17:26:04 +0100 +Subject: btrfs: fix lost error handling when replaying directory deletes + +From: Filipe Manana + +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 +Signed-off-by: Filipe Manana +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -2207,7 +2207,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; + } + diff --git a/queue-4.4/series b/queue-4.4/series index b7999209983..c8a2ed34ec0 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -20,3 +20,4 @@ mmc-winbond-don-t-build-on-m68k.patch xen-netfront-stop-tx-queues-during-live-migration.patch spi-spl022-fix-microwire-full-duplex-mode.patch vmxnet3-do-not-stop-tx-queues-after-netif_device_det.patch +btrfs-fix-lost-error-handling-when-replaying-directory-deletes.patch