Skip to contentSkip to conversation

FAILED: patch "[PATCH] btrfs: check if the transaction was aborted at" failed to apply to 5.4-stable tree

PATCH [email protected] 1 participant 1 message Jul 31, 2023

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x bf7ecbe9875061bf3fce1883e3b26b77f847d1e8
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023073104-derail-catchable-a802@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..

Possible dependencies:

bf7ecbe98750 ("btrfs: check if the transaction was aborted at btrfs_wait_for_commit()") d0c2f4fa555e ("btrfs: make concurrent fsyncs wait less when waiting for a transaction commit") bf31f87f71cc ("btrfs: add wrapper for transaction abort predicate")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From bf7ecbe9875061bf3fce1883e3b26b77f847d1e8 Mon Sep 17 00:00:00 2001
From: Filipe Manana <[email protected]>
Date: Fri, 21 Jul 2023 10:49:20 +0100
Subject: [PATCH] btrfs: check if the transaction was aborted at
btrfs_wait_for_commit()

At btrfs_wait_for_commit() we wait for a transaction to finish and then always return 0 (success) without checking if it was aborted, in which case the transaction didn't happen due to some critical error. Fix this by checking if the transaction was aborted.

Fixes 462045928bda ("Btrfs: add START_SYNC, WAIT_SYNC ioctls")
fs/btrfs/transaction.c +1 -0
index cf306351b148..f11d803b2c4e 100644
@@ -931,6 +931,7 @@ int btrfs_wait_for_commit(struct btrfs_fs_info *fs_info, u64 transid)
 	}
 
 	wait_for_commit(cur_trans, TRANS_STATE_COMPLETED);
+	ret = cur_trans->aborted;
 	btrfs_put_transaction(cur_trans);
 out:
 	return ret;