summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-06-14 16:32:44 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:06 -0400
commit8ee529e9c16b9c72293794f441270e954a9c6508 (patch)
treed6bc541ad347dddd1db8d1536645a0783f42a65d /fs/bcachefs/buckets.c
parent2ed5cd508d0b893ded6a1ba586f7c6cd7a95cc36 (diff)
downloadlwn-8ee529e9c16b9c72293794f441270e954a9c6508.tar.gz
lwn-8ee529e9c16b9c72293794f441270e954a9c6508.zip
bcachefs: Make sure bch2_trans_mark_update uses correct iter flags
Now that bch2_btree_iter_peek_with_updates() has been removed in favor of BTREE_ITER_WITH_UPDATES, we need to make sure it's not used where we don't want it. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r--fs/bcachefs/buckets.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index da24c4038fc9..c427744a665f 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1916,7 +1916,7 @@ int bch2_trans_mark_update(struct btree_trans *trans,
unsigned flags)
{
struct bkey_s_c old;
- int ret;
+ int iter_flags, ret;
if (unlikely(flags & BTREE_TRIGGER_NORUN))
return 0;
@@ -1924,7 +1924,13 @@ int bch2_trans_mark_update(struct btree_trans *trans,
if (!btree_node_type_needs_gc(iter->btree_id))
return 0;
+ iter_flags = iter->flags & BTREE_ITER_WITH_UPDATES;
+ iter->flags &= ~BTREE_ITER_WITH_UPDATES;
+
old = bch2_btree_iter_peek_slot(iter);
+
+ iter->flags |= iter_flags;
+
ret = bkey_err(old);
if (ret)
return ret;