bcachefs: Go RW before check_alloc_info()
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 12 Dec 2022 00:14:30 +0000 (19:14 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:50 +0000 (17:09 -0400)
commitf2b542ba42a8b35d9dc43f5eab9791fea76bfd3a
tree6b3599a43744f92c3e66b170a1a2fd2457112508
parent5f5c74661713327309f124e247de61db6729bc3d
bcachefs: Go RW before check_alloc_info()

It's possible to do btree updates before going RW by adding them to the
list of updates for journal replay to do, but this is limited by what
fits in RAM. This patch switches the second alloc info phase to run
after going RW - btree_gc has already ensured the alloc btree itself is
correct - and tweaks the allocation path to deal with the potential
small inconsistencies.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_foreground.c
fs/bcachefs/bcachefs.h
fs/bcachefs/recovery.c