diff options
-rw-r--r-- | fs/bcachefs/btree_iter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index 57639b29f798..a7173ca7674c 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1515,6 +1515,9 @@ static inline struct btree_path *btree_path_alloc(struct btree_trans *trans, btree_path_overflow(trans); idx = __ffs64(~trans->paths_allocated); + if (unlikely(idx > trans->nr_max_paths)) + bch2_trans_update_max_paths(trans); + trans->paths_allocated |= 1ULL << idx; path = &trans->paths[idx]; @@ -1525,9 +1528,6 @@ static inline struct btree_path *btree_path_alloc(struct btree_trans *trans, btree_path_list_add(trans, pos, path); trans->paths_sorted = false; - - if (unlikely(idx > trans->nr_max_paths)) - bch2_trans_update_max_paths(trans); return path; } |