aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_trans_commit.c
diff options
context:
space:
mode:
authorAlan Huang <[email protected]>2025-06-12 19:01:58 +0000
committerKent Overstreet <[email protected]>2025-06-16 02:11:55 +0000
commite31144f8cbe041a572ca64d9261ceeb647ccf557 (patch)
tree81a43212b3e73e1f5eaf530f39c9810056736641 /fs/bcachefs/btree_trans_commit.c
parentbcachefs: Fix alloc_req use after free (diff)
downloadkernel-e31144f8cbe041a572ca64d9261ceeb647ccf557.tar.gz
kernel-e31144f8cbe041a572ca64d9261ceeb647ccf557.zip
bcachefs: Add missing EBUG_ON
Just like the EBUG_ON in bch2_journal_add_entry(). Signed-off-by: Alan Huang <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
Diffstat (limited to 'fs/bcachefs/btree_trans_commit.c')
-rw-r--r--fs/bcachefs/btree_trans_commit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c
index d9710801e3ee..55952143f0d3 100644
--- a/fs/bcachefs/btree_trans_commit.c
+++ b/fs/bcachefs/btree_trans_commit.c
@@ -757,6 +757,8 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags,
btree_trans_journal_entries_start(trans),
trans->journal_entries.u64s);
+ EBUG_ON(trans->journal_res.u64s < trans->journal_entries.u64s);
+
trans->journal_res.offset += trans->journal_entries.u64s;
trans->journal_res.u64s -= trans->journal_entries.u64s;