Commit 52f3a72f authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: fix check_inode_deleted_list()

check_inode_deleted_list() returns true if the inode is on the deleted
list; check_inode() was checking the return code incorrectly.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 2f300f09
...@@ -799,12 +799,9 @@ static int check_inode_deleted_list(struct btree_trans *trans, struct bpos p) ...@@ -799,12 +799,9 @@ static int check_inode_deleted_list(struct btree_trans *trans, struct bpos p)
{ {
struct btree_iter iter; struct btree_iter iter;
struct bkey_s_c k = bch2_bkey_get_iter(trans, &iter, BTREE_ID_deleted_inodes, p, 0); struct bkey_s_c k = bch2_bkey_get_iter(trans, &iter, BTREE_ID_deleted_inodes, p, 0);
int ret = bkey_err(k); int ret = bkey_err(k) ?: k.k->type == KEY_TYPE_set;
if (ret)
return ret;
bch2_trans_iter_exit(trans, &iter); bch2_trans_iter_exit(trans, &iter);
return k.k->type == KEY_TYPE_set; return ret;
} }
static int check_inode(struct btree_trans *trans, static int check_inode(struct btree_trans *trans,
...@@ -876,7 +873,7 @@ static int check_inode(struct btree_trans *trans, ...@@ -876,7 +873,7 @@ static int check_inode(struct btree_trans *trans,
if (ret < 0) if (ret < 0)
return ret; return ret;
fsck_err_on(ret, c, unlinked_inode_not_on_deleted_list, fsck_err_on(!ret, c, unlinked_inode_not_on_deleted_list,
"inode %llu:%u unlinked, but not on deleted list", "inode %llu:%u unlinked, but not on deleted list",
u.bi_inum, k.k->p.snapshot); u.bi_inum, k.k->p.snapshot);
ret = 0; ret = 0;
......
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