bcachefs: Fix ca->oldest_gen allocation
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 20 Oct 2023 16:24:36 +0000 (12:24 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 31 Oct 2023 16:18:37 +0000 (12:18 -0400)
commit253ba178c8d9065748fa56b39343e6a5a55b0023
tree694780b446d4269f0a5f5066dbf80cfff0e06ed6
parenta1d97d8417d3c2f2477847541303621c32652976
bcachefs: Fix ca->oldest_gen allocation

The ca->oldest_gen array needs to be the same size as the bucket_gens
array; ca->mi.nbuckets is updated with only state_lock held, not
gc_lock, so bch2_gc_gens() could race with device resize and allocate
too small of an oldest_gens array.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_gc.c