Commit 20826fe6 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix reattach_inode()

Ensure a copy of the lost+found inode exists in the snapshot that we're
reattaching, so that we don't trigger warnings in
lookup_inode_for_snapshot() later.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 6b63a948
...@@ -354,13 +354,12 @@ static int reattach_inode(struct btree_trans *trans, ...@@ -354,13 +354,12 @@ static int reattach_inode(struct btree_trans *trans,
if (ret) if (ret)
return ret; return ret;
if (S_ISDIR(inode->bi_mode)) { lostfound.bi_nlink += S_ISDIR(inode->bi_mode);
lostfound.bi_nlink++;
ret = __bch2_fsck_write_inode(trans, &lostfound, U32_MAX); /* ensure lost+found inode is also present in inode snapshot */
if (ret) ret = __bch2_fsck_write_inode(trans, &lostfound, inode_snapshot);
return ret; if (ret)
} return ret;
dir_hash = bch2_hash_info_init(c, &lostfound); dir_hash = bch2_hash_info_init(c, &lostfound);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment