Mesa (staging/21.2): util/fossilize_db: Reset file position to parsed_offset on cache_offset read failure.

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


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

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Thu Aug  5 03:03:48 2021 +0200

util/fossilize_db: Reset file position to parsed_offset on cache_offset read failure.

Otherwise we might restart reading from the middle of the entry.

Fixes: 2ec1bff0f3a "util/fossilize_db: Split out reading the index."
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>
(cherry picked from commit 57ca07455ce03006aa4f6b66a5b0fe67570a1593)

---

 .pick_status.json       | 2 +-
 src/util/fossilize_db.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index db00f80deab..341f7a1dcbb 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -616,7 +616,7 @@
         "description": "util/fossilize_db: Reset file position to parsed_offset on cache_offset read failure.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "2ec1bff0f3a4450a9739d59421dc9c9fe72c94c6"
     },
diff --git a/src/util/fossilize_db.c b/src/util/fossilize_db.c
index 8a380812425..6737cf2b21b 100644
--- a/src/util/fossilize_db.c
+++ b/src/util/fossilize_db.c
@@ -157,7 +157,7 @@ update_foz_index(struct foz_db *foz_db, FILE *db_idx, unsigned file_idx)
       uint64_t cache_offset;
       if (fread(&cache_offset, 1, sizeof(cache_offset), db_idx) !=
           sizeof(cache_offset))
-         return;
+         break;
 
       entry->offset = cache_offset;
 



More information about the mesa-commit mailing list