summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-10-07 15:09:30 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2019-10-07 15:09:30 -0400
commitb83dba0d3fde8d424a274a0936d9c436d770b3aa (patch)
tree5494509320500068a3de3b290cf3db0f3db5491e
parentce9c3373f2936da244dc80e945e2dc944fd23fec (diff)
bcachefs: Fix incorrect use of bch2_extent_atomic_end()
bch2_extent_atomic_end counts the number of iterators requried for marking overwrites - but journal replay never marks overwrites, so that part was incorrect. And counting iterators for the key being inserted should be unnecessary because we did that prior to the key being inserted before it was first journalled. This should fix an iterator overflow bug - the iterators for walking overwrites were totally unneeded. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/recovery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 97c0d7d1fe77..095eef3828ce 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -268,10 +268,12 @@ retry:
BTREE_ITER_INTENT);
do {
- ret = bch2_extent_atomic_end(iter, k, &atomic_end);
+ ret = bch2_btree_iter_traverse(iter);
if (ret)
goto err;
+ atomic_end = bpos_min(k->k.p, iter->l[0].b->key.k.p);
+
split_iter = bch2_trans_copy_iter(&trans, iter);
ret = PTR_ERR_OR_ZERO(split_iter);
if (ret)