aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_trans_commit.c
diff options
context:
space:
mode:
authorKent Overstreet <[email protected]>2024-09-24 02:12:31 +0000
committerKent Overstreet <[email protected]>2025-02-12 23:40:19 +0000
commit9cf6b84b71adb97f3c19476ebb5a42228fad89b5 (patch)
treed5cda508ff0836cc09bc44d13c17c5a01df8a82a /fs/bcachefs/btree_trans_commit.c
parentbcachefs: Fix want_new_bset() so we write until the end of the btree node (diff)
downloadkernel-9cf6b84b71adb97f3c19476ebb5a42228fad89b5.tar.gz
kernel-9cf6b84b71adb97f3c19476ebb5a42228fad89b5.zip
bcachefs: CONFIG_BCACHEFS_INJECT_TRANSACTION_RESTARTS
Incorrectly handled transaction restarts can be a source of heisenbugs; add a mode where we randomly inject them to shake them out. Signed-off-by: Kent Overstreet <[email protected]>
Diffstat (limited to 'fs/bcachefs/btree_trans_commit.c')
-rw-r--r--fs/bcachefs/btree_trans_commit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c
index 2760dd9569ed..c4f524b2ca9a 100644
--- a/fs/bcachefs/btree_trans_commit.c
+++ b/fs/bcachefs/btree_trans_commit.c
@@ -999,6 +999,10 @@ int __bch2_trans_commit(struct btree_trans *trans, unsigned flags)
bch2_trans_verify_not_unlocked_or_in_restart(trans);
+ ret = trans_maybe_inject_restart(trans, _RET_IP_);
+ if (unlikely(ret))
+ goto out_reset;
+
if (!trans->nr_updates &&
!trans->journal_entries_u64s)
goto out_reset;