diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-09 19:22:12 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:50 +0200 |
commit | 30ca6ece88f2d11647c3854faf0dce528c32d5cf (patch) | |
tree | 56d1d0fcec9b2416e0d7e59505bfdffd847f15fd /fs/bcachefs/btree_key_cache.c | |
parent | bcachefs: trans->notrace_relock_fail (diff) | |
download | linux-30ca6ece88f2d11647c3854faf0dce528c32d5cf.tar.xz linux-30ca6ece88f2d11647c3854faf0dce528c32d5cf.zip |
bcachefs: Kill trans->flags
Recursive transaction commits are occasionally necessary - in
particular, for the upcoming btree write buffer's flush path.
This avoids bugs due to trans->flags being accidentally mutated
mid-commit, which can cause c->writes refcount leaks.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_key_cache.c')
-rw-r--r-- | fs/bcachefs/btree_key_cache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_key_cache.c b/fs/bcachefs/btree_key_cache.c index 867f063f22d1..67db6b9d8e10 100644 --- a/fs/bcachefs/btree_key_cache.c +++ b/fs/bcachefs/btree_key_cache.c @@ -769,6 +769,7 @@ int bch2_btree_key_cache_flush(struct btree_trans *trans, } bool bch2_btree_insert_key_cached(struct btree_trans *trans, + unsigned flags, struct btree_path *path, struct bkey_i *insert) { @@ -778,7 +779,7 @@ bool bch2_btree_insert_key_cached(struct btree_trans *trans, BUG_ON(insert->u64s > ck->u64s); - if (likely(!(trans->flags & BTREE_INSERT_JOURNAL_REPLAY))) { + if (likely(!(flags & BTREE_INSERT_JOURNAL_REPLAY))) { int difference; BUG_ON(jset_u64s(insert->u64s) > trans->journal_preres.u64s); |