diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-18 20:25:09 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:10:04 +0300 |
commit | 25aa8c2167306a3919fb6503494cd6078e33a71e (patch) | |
tree | d53f42f9a05600688a64c75374c50c9610c469ba /fs | |
parent | 45a1ab57ddb53a8b392baab2142c909154a8d37c (diff) | |
download | linux-25aa8c2167306a3919fb6503494cd6078e33a71e.tar.xz |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/btree_cache.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/btree_locking.c | 8 | ||||
-rw-r--r-- | fs/bcachefs/btree_locking.h | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_cache.c b/fs/bcachefs/btree_cache.c index 681a47b70a65..435e68888918 100644 --- a/fs/bcachefs/btree_cache.c +++ b/fs/bcachefs/btree_cache.c @@ -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); diff --git a/fs/bcachefs/btree_locking.c b/fs/bcachefs/btree_locking.c index 23a6d63223af..dc3aa70a0380 100644 --- a/fs/bcachefs/btree_locking.c +++ b/fs/bcachefs/btree_locking.c @@ -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; diff --git a/fs/bcachefs/btree_locking.h b/fs/bcachefs/btree_locking.h index d3837c25f110..3b537e451d2c 100644 --- a/fs/bcachefs/btree_locking.h +++ b/fs/bcachefs/btree_locking.h @@ -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); |