]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcachefs: Don't lose needs_whiteout in overwrite path
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 5 Jan 2020 23:20:23 +0000 (18:20 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:34 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_update_leaf.c

index 9ad2e3e90d5bb5a04b768546d5477a6a4c257781..3dc6b35b2e6ac63b9bf59d405794074dfd7aaa67 100644 (file)
@@ -99,13 +99,14 @@ bool bch2_btree_bset_insert_key(struct btree_iter *iter,
 
                }
 
+               insert->k.needs_whiteout = k->needs_whiteout;
+               k->needs_whiteout = false;
+
                if (k >= btree_bset_last(b)->start) {
                        clobber_u64s = k->u64s;
                        goto overwrite;
                }
 
-               insert->k.needs_whiteout = k->needs_whiteout;
-               k->needs_whiteout = false;
                k->type = KEY_TYPE_deleted;
                /*
                 * XXX: we should be able to do this without two calls to