mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
bcachefs: Fix snapshot_key_missing_inode_snapshot repair
When the inode was a whiteout, we were inserting a new whiteout at the wrong (old) snapshot. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
c1ccd43b35
commit
c27e5782d9
|
|
@ -903,17 +903,15 @@ lookup_inode_for_snapshot(struct btree_trans *trans, struct inode_walker *w, str
|
|||
w->last_pos.inode, k.k->p.snapshot, i->inode.bi_snapshot,
|
||||
(bch2_bkey_val_to_text(&buf, c, k),
|
||||
buf.buf))) {
|
||||
struct bch_inode_unpacked new = i->inode;
|
||||
struct bkey_i whiteout;
|
||||
|
||||
new.bi_snapshot = k.k->p.snapshot;
|
||||
|
||||
if (!i->whiteout) {
|
||||
struct bch_inode_unpacked new = i->inode;
|
||||
new.bi_snapshot = k.k->p.snapshot;
|
||||
ret = __bch2_fsck_write_inode(trans, &new);
|
||||
} else {
|
||||
struct bkey_i whiteout;
|
||||
bkey_init(&whiteout.k);
|
||||
whiteout.k.type = KEY_TYPE_whiteout;
|
||||
whiteout.k.p = SPOS(0, i->inode.bi_inum, i->inode.bi_snapshot);
|
||||
whiteout.k.p = SPOS(0, i->inode.bi_inum, k.k->p.snapshot);
|
||||
ret = bch2_btree_insert_nonextent(trans, BTREE_ID_inodes,
|
||||
&whiteout,
|
||||
BTREE_UPDATE_internal_snapshot_node);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user