mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
bcachefs: Fix btree key cache coherency during replay
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
5d04409a62
commit
b3f8e71117
@ -380,9 +380,11 @@ static int btree_key_cache_fill(struct btree_trans *trans,
|
|||||||
struct bkey_i *new_k = NULL;
|
struct bkey_i *new_k = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
k = bch2_bkey_get_iter(trans, &iter, ck->key.btree_id, ck->key.pos,
|
bch2_trans_iter_init(trans, &iter, ck->key.btree_id, ck->key.pos,
|
||||||
BTREE_ITER_KEY_CACHE_FILL|
|
BTREE_ITER_KEY_CACHE_FILL|
|
||||||
BTREE_ITER_CACHED_NOFILL);
|
BTREE_ITER_CACHED_NOFILL);
|
||||||
|
iter.flags &= ~BTREE_ITER_WITH_JOURNAL;
|
||||||
|
k = bch2_btree_iter_peek_slot(&iter);
|
||||||
ret = bkey_err(k);
|
ret = bkey_err(k);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -452,7 +452,7 @@ bch2_trans_update_by_path(struct btree_trans *trans, btree_path_idx_t path_idx,
|
|||||||
* the key cache - but the key has to exist in the btree for that to
|
* the key cache - but the key has to exist in the btree for that to
|
||||||
* work:
|
* work:
|
||||||
*/
|
*/
|
||||||
if (path->cached && bkey_deleted(&i->old_k))
|
if (path->cached && !i->old_btree_u64s)
|
||||||
return flush_new_cached_update(trans, i, flags, ip);
|
return flush_new_cached_update(trans, i, flags, ip);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user