Commit 25aa8c21 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch2_trans_unlock_noassert()

This fixes a spurious assert in the btree node read path.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 45a1ab57
......@@ -744,7 +744,7 @@ static noinline struct btree *bch2_btree_node_fill(struct btree_trans *trans,
/* Unlock before doing IO: */
if (trans && sync)
bch2_trans_unlock(trans);
bch2_trans_unlock_noassert(trans);
bch2_btree_node_read(c, b, sync);
......
......@@ -715,6 +715,14 @@ int bch2_trans_relock_notrace(struct btree_trans *trans)
return 0;
}
void bch2_trans_unlock_noassert(struct btree_trans *trans)
{
struct btree_path *path;
trans_for_each_path(trans, path)
__bch2_btree_path_unlock(trans, path);
}
void bch2_trans_unlock(struct btree_trans *trans)
{
struct btree_path *path;
......
......@@ -21,6 +21,8 @@ void bch2_assert_btree_nodes_not_locked(void);
static inline void bch2_assert_btree_nodes_not_locked(void) {}
#endif
void bch2_trans_unlock_noassert(struct btree_trans *);
static inline bool is_btree_node(struct btree_path *path, unsigned l)
{
return l < BTREE_MAX_DEPTH && !IS_ERR_OR_NULL(path->l[l].b);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment