summaryrefslogtreecommitdiff
path: root/libbcachefs/debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-10-09 02:32:57 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2022-10-09 02:33:05 -0400
commit8d6138baac3b4fcd715c34cf325ae11b01a4ca67 (patch)
tree7b2aeefc77ca3c31e2686ca4bceaad13cd0a24d9 /libbcachefs/debug.c
parent99caca2c70f312c4a2504a7e7a9c92a91426d885 (diff)
Update bcachefs sources to cbccc6d869 bcachefs: Ratelimit ec error message
Diffstat (limited to 'libbcachefs/debug.c')
-rw-r--r--libbcachefs/debug.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libbcachefs/debug.c b/libbcachefs/debug.c
index bff5e9b6..1d2a1615 100644
--- a/libbcachefs/debug.c
+++ b/libbcachefs/debug.c
@@ -724,11 +724,18 @@ static ssize_t bch2_btree_deadlock_read(struct file *file, char __user *buf,
goto out;
mutex_lock(&c->btree_trans_lock);
- list_for_each_entry(trans, &c->btree_trans_list, list)
- if (bch2_check_for_deadlock(trans, &i->buf)) {
- i->iter = 1;
- break;
- }
+ list_for_each_entry(trans, &c->btree_trans_list, list) {
+ if (trans->locking_wait.task->pid <= i->iter)
+ continue;
+
+ ret = flush_buf(i);
+ if (ret)
+ return ret;
+
+ bch2_check_for_deadlock(trans, &i->buf);
+
+ i->iter = trans->locking_wait.task->pid;
+ }
mutex_unlock(&c->btree_trans_lock);
out:
if (i->buf.allocation_failure)