Mesa (staging/21.2): util/fossilize_db: Unlock the cache file if the entry already exists.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 9 21:46:59 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 07581c4842ba876fadc7e711ef14bb9924185609
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=07581c4842ba876fadc7e711ef14bb9924185609

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 add6a910a11..cc3ce6a52c6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -571,7 +571,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 d3c039e90d3..013575a67a1 100644
--- a/src/util/fossilize_db.c
+++ b/src/util/fossilize_db.c
@@ -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;
    }
 



More information about the mesa-commit mailing list