diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-27 07:38:50 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-10 15:17:00 -0400 |
commit | 52f3a72fa7f4f021398d17e4ffa760d0b2a46386 (patch) | |
tree | 78db6280cbb3e78251b131807daa45ab0aff5000 /fs/bcachefs/fsck.c | |
parent | 2f300f09c7899eb35077aad0a1634cd06a29423a (diff) | |
download | linux-stable-52f3a72fa7f4f021398d17e4ffa760d0b2a46386.tar.gz linux-stable-52f3a72fa7f4f021398d17e4ffa760d0b2a46386.tar.bz2 linux-stable-52f3a72fa7f4f021398d17e4ffa760d0b2a46386.zip |
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: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r-- | fs/bcachefs/fsck.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index 6a760777bafb..ac4e40ad168d 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -799,12 +799,9 @@ static int check_inode_deleted_list(struct btree_trans *trans, struct bpos p) { struct btree_iter iter; struct bkey_s_c k = bch2_bkey_get_iter(trans, &iter, BTREE_ID_deleted_inodes, p, 0); - int ret = bkey_err(k); - if (ret) - return ret; - + int ret = bkey_err(k) ?: k.k->type == KEY_TYPE_set; bch2_trans_iter_exit(trans, &iter); - return k.k->type == KEY_TYPE_set; + return ret; } static int check_inode(struct btree_trans *trans, @@ -876,7 +873,7 @@ static int check_inode(struct btree_trans *trans, if (ret < 0) 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", u.bi_inum, k.k->p.snapshot); ret = 0; |