bcachefs: debug: Fix some locking bugs
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 25 Jan 2023 00:42:04 +0000 (19:42 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:49 +0000 (17:09 -0400)
This fixes a few error paths in debug code that lead to locks failing to
be dropped.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/debug.c

index ab210296223b145b96c752ef2dd1fda85da23bd9..fcefd55a5322474405ae9558a7008439aa51e309 100644 (file)
@@ -520,7 +520,7 @@ static ssize_t bch2_btree_transactions_read(struct file *file, char __user *buf,
 
                ret = flush_buf(i);
                if (ret)
-                       return ret;
+                       break;
 
                bch2_btree_trans_to_text(&i->buf, trans);
 
@@ -711,7 +711,7 @@ static ssize_t bch2_btree_deadlock_read(struct file *file, char __user *buf,
 
                ret = flush_buf(i);
                if (ret)
-                       return ret;
+                       break;
 
                bch2_check_for_deadlock(trans, &i->buf);