Skip to content

Commit 06ebc48

Browse files
author
Kent Overstreet
committed
bcachefs: fix deletion of indirect extents in btree_gc
we need to run the normal extent update path on deletion - bch2_bkey_make_mut() is incorrect when key type is changing. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 3e48999 commit 06ebc48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/bcachefs/btree_gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,8 +1586,7 @@ static int bch2_gc_write_reflink_key(struct btree_trans *trans,
15861586
" should be %u",
15871587
(bch2_bkey_val_to_text(&buf, c, k), buf.buf),
15881588
r->refcount)) {
1589-
struct bkey_i *new = bch2_bkey_make_mut(trans, iter, &k, 0);
1590-
1589+
struct bkey_i *new = bch2_bkey_make_mut_noupdate(trans, k);
15911590
ret = PTR_ERR_OR_ZERO(new);
15921591
if (ret)
15931592
return ret;
@@ -1596,6 +1595,7 @@ static int bch2_gc_write_reflink_key(struct btree_trans *trans,
15961595
new->k.type = KEY_TYPE_deleted;
15971596
else
15981597
*bkey_refcount(bkey_i_to_s(new)) = cpu_to_le64(r->refcount);
1598+
ret = bch2_trans_update(trans, iter, new, 0);
15991599
}
16001600
fsck_err:
16011601
printbuf_exit(&buf);

0 commit comments

Comments
 (0)