This fixes a spurious assert in the btree node read path.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
/* Unlock before doing IO: */
if (trans && sync)
- bch2_trans_unlock(trans);
+ bch2_trans_unlock_noassert(trans);
bch2_btree_node_read(c, b, sync);
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;
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);