summaryrefslogtreecommitdiff
path: root/fs/bcachefs/debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-08 07:50:38 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 19:47:40 +0300
commitbe1fa63de867aa26f2f57e6f5db2a358f6da5ad1 (patch)
treeb3ebc2d45acd3a07c3b0400969421e3a65b52610 /fs/bcachefs/debug.c
parenta0acc24fedbe067b30f4320daa8d63b404f6ccd9 (diff)
downloadlinux-be1fa63de867aa26f2f57e6f5db2a358f6da5ad1.tar.xz
bcachefs: Fix bch2_read_btree()
In the debugfs code, we had an incorrect use of drop_locks_do(); on transaction restart we don't want to restart the current loop iteration, since we've already emitted the current key to the buffer for userspace. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/debug.c')
-rw-r--r--fs/bcachefs/debug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c
index 57c5128db173..c45421a2f408 100644
--- a/fs/bcachefs/debug.c
+++ b/fs/bcachefs/debug.c
@@ -385,7 +385,8 @@ static ssize_t bch2_read_btree(struct file *file, char __user *buf,
BTREE_ITER_ALL_SNAPSHOTS, k, ({
bch2_bkey_val_to_text(&i->buf, i->c, k);
prt_newline(&i->buf);
- drop_locks_do(trans, flush_buf(i));
+ bch2_trans_unlock(trans);
+ flush_buf(i);
}));
i->from = iter.pos;
@@ -490,7 +491,8 @@ static ssize_t bch2_read_bfloat_failed(struct file *file, char __user *buf,
}
bch2_bfloat_to_text(&i->buf, l->b, _k);
- drop_locks_do(trans, flush_buf(i));
+ bch2_trans_unlock(trans);
+ flush_buf(i);
}));
i->from = iter.pos;