Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
 
        /* Cause future lookups for this node to fail: */
        b->hash_val = 0;
+
+       six_lock_wakeup_all(&b->c.lock);
 }
 
 int __bch2_btree_node_hash_insert(struct btree_cache *bc, struct btree *b)
 
 
        bch2_btree_node_hash_remove(&c->btree_cache, b);
 
-       six_lock_wakeup_all(&b->c.lock);
-
        mutex_lock(&c->btree_cache.lock);
        list_move(&b->list, &c->btree_cache.freeable);
        mutex_unlock(&c->btree_cache.lock);