bcachefs: Disk space accounting fix on brand-new fs
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 15 Nov 2021 20:02:13 +0000 (15:02 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:17 +0000 (17:09 -0400)
commitc714614bd06cc422f56c02475adf03dc618bf385
tree82e12f009dd33d431d66dd19ee3195c8457d4e3e
parent0a84a066f9a1455ce703850ac5918270d7a4019d
bcachefs: Disk space accounting fix on brand-new fs

The filesystem initialization path first marks superblock and journal
buckets non transactionally, since the btree isn't functional yet. That
path was updating the per-journal-buf percpu counters via
bch2_dev_usage_update(), and updating the wrong set of counters so those
updates didn't get written out until journal entry 4.

The relevant code is going to get significantly rewritten in the future
as we transition away from the in memory bucket array, so this just
hacks around it for now.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/bcachefs.h
fs/bcachefs/buckets.c
fs/bcachefs/super-io.c