bcachefs: Fix usage of six lock's percpu mode, key cache version
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 4 Sep 2022 02:07:31 +0000 (22:07 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:40 +0000 (17:09 -0400)
commit3d21d48e898a2eadc9055c44e0fd51e6087c9e9f
treec52654bf87cab72d256887cd103142047cdf139e
parent0242130fb67fdcc617229fb9112c50f4caabab3c
bcachefs: Fix usage of six lock's percpu mode, key cache version

Similar to "bcachefs: Fix usage of six lock's percpu mode", six locks
have a percpu mode, but we can't switch between percpu and non percpu
modes while a lock is in use: threads attempting to take a read lock may
race, and we'll end up with the read count permanently off.

Fixing this the "correct" way, in six_lock_pcpu_(alloc|free) would
require an RCU barrier, and we don't want to do that - instead, we have
to permanently segragate percpu and non percpu objects, including when
on freelists.

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