bcachefs: Don't set btree_path to updtodate if we don't fill
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 31 Dec 2024 17:58:23 +0000 (12:58 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 10 Jan 2025 04:38:42 +0000 (23:38 -0500)
This fixes various locking asserts, and a null ptr deref in
bch2_btree_iter_peek_path().

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_key_cache.c

index 7636a5e974097dba48b30d60fe9c5171723a03d8..3b62296c3100e77ffe17c0446e0d5150cd39e0b1 100644 (file)
@@ -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;