util/fossilize_db: Unlock the cache file if the entry already exists.

Fixes: 4f0f8133a3 "util/fossilize_db: Do not lock the fossilize db permanently."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12266>
This commit is contained in:
Bas Nieuwenhuizen 2021-08-07 23:23:56 +02:00
parent 1c4dce1aa7
commit 75266ee44a
1 changed files with 1 additions and 0 deletions

View File

@ -448,6 +448,7 @@ foz_write_entry(struct foz_db *foz_db, const uint8_t *cache_key_160bit,
_mesa_hash_table_u64_search(foz_db->index_db, hash);
if (entry) {
simple_mtx_unlock(&foz_db->mtx);
flock(fileno(foz_db->file[0]), LOCK_UN);
return NULL;
}