From: Kent Overstreet Date: Mon, 7 Oct 2019 19:09:30 +0000 (-0400) Subject: bcachefs: Fix incorrect use of bch2_extent_atomic_end() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a40d97a771387362dd272608ed2df0a1fd39343e;p=linux.git 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 --- diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 97c0d7d1fe772..095eef3828cec 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)