bcachefs: fix unsafety in bch2_extent_ptr_to_text()
Need to check if we have a valid bucket before checking if ptr is stale Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
87cb0239c8
commit
dc32c118ec
@ -998,7 +998,9 @@ void bch2_extent_ptr_to_text(struct printbuf *out, struct bch_fs *c, const struc
|
|||||||
prt_str(out, " cached");
|
prt_str(out, " cached");
|
||||||
if (ptr->unwritten)
|
if (ptr->unwritten)
|
||||||
prt_str(out, " unwritten");
|
prt_str(out, " unwritten");
|
||||||
if (ca && ptr_stale(ca, ptr))
|
if (b >= ca->mi.first_bucket &&
|
||||||
|
b < ca->mi.nbuckets &&
|
||||||
|
ptr_stale(ca, ptr))
|
||||||
prt_printf(out, " stale");
|
prt_printf(out, " stale");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user