bcachefs: bch2_trans_unlock_noassert()

This fixes a spurious assert in the btree node read path.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet
2023-06-18 13:25:09 -04:00
parent 45a1ab57dd
commit 25aa8c2167
3 changed files with 11 additions and 1 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);