bcachefs: Fix locking in bch2_btree_iter_traverse_cached()
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 8 Mar 2021 22:09:13 +0000 (17:09 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:55 +0000 (17:08 -0400)
commit53b3e3c0e2f14f661cd61bbc9b82dc9383f783b9
treea3e1b37689d92e5fd06e2fe884c4943b27151c20
parentc7bb769c81cca29462b39ea4689991b9b4d786fb
bcachefs: Fix locking in bch2_btree_iter_traverse_cached()

bch2_btree_iter_traverse() is supposed to ensure we have the correct
type of lock - it was downgrading if necessary, but if we entered with a
read lock it wasn't upgrading to an intent lock, oops.

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