bcachefs: Fix BTREE_INSERT_NOMARK_OVERWRITES
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 29 Aug 2019 17:29:31 +0000 (13:29 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:26 +0000 (17:08 -0400)
bch2_mark_update() was correct, but bch2_trans_mark_update() wasn't
respecting BTREE_INSERT_NOMARK_OVERWRITES - key marking/triggers really
need to be cleaned up.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/buckets.c

index d732ec77e281faf5a7a6cce5bb135055e58270da..774201a1c0c55f6a2355873e24b2777dcf54a394 100644 (file)
@@ -1762,6 +1762,9 @@ int bch2_trans_mark_update(struct btree_trans *trans,
        if (ret)
                return ret;
 
+       if (unlikely(trans->flags & BTREE_INSERT_NOMARK_OVERWRITES))
+               return 0;
+
        while ((_k = bch2_btree_node_iter_peek_filter(&node_iter, b,
                                                      KEY_TYPE_discard))) {
                struct bkey             unpacked;