From: Kent Overstreet Date: Tue, 31 Dec 2024 17:58:23 +0000 (-0500) Subject: bcachefs: Don't set btree_path to updtodate if we don't fill X-Git-Tag: io_uring-6.14-20240131~27^2~16 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=bd5b09727f3d13bb3c782b5f05041c69784e7fe9;p=linux-block.git bcachefs: Don't set btree_path to updtodate if we don't fill This fixes various locking asserts, and a null ptr deref in bch2_btree_iter_peek_path(). Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_key_cache.c b/fs/bcachefs/btree_key_cache.c index 7636a5e97409..3b62296c3100 100644 --- a/fs/bcachefs/btree_key_cache.c +++ b/fs/bcachefs/btree_key_cache.c @@ -291,10 +291,8 @@ static noinline int btree_key_cache_fill(struct btree_trans *trans, struct btree_path *ck_path, unsigned flags) { - if (flags & BTREE_ITER_cached_nofill) { - ck_path->uptodate = BTREE_ITER_UPTODATE; + if (flags & BTREE_ITER_cached_nofill) return 0; - } struct bch_fs *c = trans->c; struct btree_iter iter;