Commit a5e3dce4 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix assert in bch2_backpointer_invalid()

Backpointers that point to invalid devices are caught by fsck, not
.key_invalid; so .key_invalid needs to check for them instead of hitting
asserts.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 39cd87c4
......@@ -44,6 +44,11 @@ int bch2_backpointer_invalid(struct bch_fs *c, struct bkey_s_c k,
struct printbuf *err)
{
struct bkey_s_c_backpointer bp = bkey_s_c_to_backpointer(k);
/* these will be caught by fsck */
if (!bch2_dev_exists2(c, bp.k->p.inode))
return 0;
struct bpos bucket = bp_pos_to_bucket(c, bp.k->p);
int 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