Commit db18ef1a authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix bch2_check_nlinks() for snapshots



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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 7125063f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,