Skip to content

Commit 87313ac

Browse files
author
Kent Overstreet
committed
bcachefs: clear path->should_be_locked in bch2_btree_key_cache_drop()
bch2_btree_key_cache_drop() evicts the key cache entry - it's used when we're doing an update that bypasses the key cache, because for cache coherency reasons a key can't be in the key cache unless it also exists in the btree - i.e. creates have to bypass the cache. After evicting, the path no longer points to a key cache key, and relock() will always fail if should_be_locked is true. Prep for improving path->should_be_locked assertions Signed-off-by: Kent Overstreet <[email protected]>
1 parent dedb2fe commit 87313ac

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/bcachefs/btree_key_cache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ void bch2_btree_key_cache_drop(struct btree_trans *trans,
726726

727727
mark_btree_node_locked(trans, path, 0, BTREE_NODE_UNLOCKED);
728728
btree_path_set_dirty(path, BTREE_ITER_NEED_TRAVERSE);
729+
path->should_be_locked = false;
729730
}
730731

731732
static unsigned long bch2_btree_key_cache_scan(struct shrinker *shrink,

0 commit comments

Comments
 (0)