bcachefs: Path must be locked if trans->locked && should_be_locked
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 10 Apr 2024 03:53:57 +0000 (23:53 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 23 May 2025 11:59:43 +0000 (07:59 -0400)
commitb41ac97fe0a6876edbc6fc90dfd05513ba7332ed
tree80da5cedf03bad7e75c63ce5e78327b39f51713d
parent22e921a6f9b8ec4c9ccbef4accae1494c6695745
bcachefs: Path must be locked if trans->locked && should_be_locked

If path->should_be_locked is true, that means user code (of the btree
API) has seen, in this transaction, something guarded by the node this
path has locked, and we have to keep it locked until the end of the
transaction.

Assert that we're not violating this; should_be_locked should also be
cleared only in _very_ special situations.

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