Mesa (staging/21.1): util/fossilize_db: Unlock the cache file if the entry already exists.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 9 07:32:38 UTC 2021
Module: Mesa
Branch: staging/21.1
Commit: 4421d6e1525d41946d3d85a83cc7f9b6f9d1473f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4421d6e1525d41946d3d85a83cc7f9b6f9d1473f
Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date: Sat Aug 7 23:23:56 2021 +0200
util/fossilize_db: Unlock the cache file if the entry already exists.
Fixes: 4f0f8133a35 "util/fossilize_db: Do not lock the fossilize db permanently."
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12266>
(cherry picked from commit 75266ee44a07cc97125511f5129adb8e696e3bdc)
---
.pick_status.json | 2 +-
src/util/fossilize_db.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 742d14ee759..a6cd8631bab 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -148,7 +148,7 @@
"description": "util/fossilize_db: Unlock the cache file if the entry already exists.",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "4f0f8133a35ec2fec8d99936cd7425e40d092169"
},
diff --git a/src/util/fossilize_db.c b/src/util/fossilize_db.c
index aaccc12cf4c..0bca743f425 100644
--- a/src/util/fossilize_db.c
+++ b/src/util/fossilize_db.c
@@ -458,6 +458,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;
}
More information about the mesa-commit
mailing list