Signed-off-by: Alan Huang <[email protected]>
---
 fs/bcachefs/btree_locking.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/bcachefs/btree_locking.c b/fs/bcachefs/btree_locking.c
index 617478fd5351..50d9366d49bd 100644
--- a/fs/bcachefs/btree_locking.c
+++ b/fs/bcachefs/btree_locking.c
@@ -229,8 +229,7 @@ static noinline int break_cycle(struct lock_graph *g, 
struct printbuf *cycle)
        ret = abort_lock(g, abort);
 out:
        if (ret)
-               while (g->nr)
-                       lock_graph_up(g);
+               lock_graph_pop_all(g);
        return ret;
 }
 
@@ -252,8 +251,7 @@ static int lock_graph_descend(struct lock_graph *g, struct 
btree_trans *trans,
                if (orig_trans->lock_may_not_fail)
                        return 0;
 
-               while (g->nr)
-                       lock_graph_up(g);
+               lock_graph_pop_all(g);
 
                if (cycle)
                        return 0;
-- 
2.45.2


Reply via email to