Skip to content

Commit

Permalink
bcachefs: Fix bch2_check_nlinks() for snapshots
Browse files Browse the repository at this point in the history
When searching the link table for the matching inode, we were searching
for a specific - incorrect - snapshot ID as well, causing us to fail to
find the inode.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
  • Loading branch information
Kent Overstreet committed Nov 15, 2023
1 parent 7125063 commit db18ef1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/bcachefs/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -2220,7 +2220,7 @@ static int nlink_cmp(const void *_l, const void *_r)
const struct nlink *l = _l;
const struct nlink *r = _r;

return cmp_int(l->inum, r->inum) ?: cmp_int(l->snapshot, r->snapshot);
return cmp_int(l->inum, r->inum);
}

static void inc_link(struct bch_fs *c, struct snapshots_seen *s,
Expand Down

0 comments on commit db18ef1

Please sign in to comment.