summaryrefslogtreecommitdiff
path: root/libbcachefs/fsck.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/fsck.c')
-rw-r--r--libbcachefs/fsck.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libbcachefs/fsck.c b/libbcachefs/fsck.c
index f0eb17e6..a1087fd2 100644
--- a/libbcachefs/fsck.c
+++ b/libbcachefs/fsck.c
@@ -1182,7 +1182,7 @@ static int check_inode(struct btree_trans *trans,
if (ret)
u.bi_flags |= BCH_INODE_has_child_snapshot;
else
- u.bi_flags &= !BCH_INODE_has_child_snapshot;
+ u.bi_flags &= ~BCH_INODE_has_child_snapshot;
do_update = true;
}
ret = 0;
@@ -1213,7 +1213,11 @@ static int check_inode(struct btree_trans *trans,
if (ret)
goto err;
} else {
- if (fsck_err_on(!bch2_inode_is_open(c, k.k->p),
+ ret = bch2_inode_or_descendents_is_open(trans, k.k->p);
+ if (ret < 0)
+ goto err;
+
+ if (fsck_err_on(!ret,
trans, inode_unlinked_and_not_open,
"inode %llu%u unlinked and not open",
u.bi_inum, u.bi_snapshot)) {
@@ -1221,6 +1225,7 @@ static int check_inode(struct btree_trans *trans,
bch_err_msg(c, ret, "in fsck deleting inode");
goto err_noprint;
}
+ ret = 0;
}
}