diff options
author | Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> | 2021-08-05 01:26:15 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-08-09 14:46:36 -0700 |
commit | 8d52e3cd38aa7039f4db6563c3ff711b021bbe8f (patch) | |
tree | bb2ef34d058fa3068a1e3db77100083bc39e9f6f | |
parent | 568bbe0dd20a48aa4520c692ffbc7daabadf413d (diff) |
util/fossilize_db: Update parsed_offset correctly.
If things went perfectly parsed_offset was never updated for the
final entry and we'd seek_set to the start of the last entry. Is
fun when appending to the file next.
Fixes: 2ec1bff0f3a "util/fossilize_db: Split out reading the index."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>
(cherry picked from commit 3c51a3aa954bb09ceb7c101dc02c1b11fb250bbf)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/util/fossilize_db.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json index 95fbdb85250..db00f80deab 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -625,7 +625,7 @@ "description": "util/fossilize_db: Update parsed_offset correctly.", "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 8032e979b67..8a380812425 100644 --- a/src/util/fossilize_db.c +++ b/src/util/fossilize_db.c @@ -120,8 +120,6 @@ update_foz_index(struct foz_db *foz_db, FILE *db_idx, unsigned file_idx) fseek(db_idx, offset, SEEK_SET); while (offset < len) { - parsed_offset = offset; - char bytes_to_read[FOSSILIZE_BLOB_HASH_LENGTH + sizeof(struct foz_payload_header)]; struct foz_payload_header *header; @@ -171,6 +169,7 @@ update_foz_index(struct foz_db *foz_db, FILE *db_idx, unsigned file_idx) _mesa_hash_table_u64_insert(foz_db->index_db, key, entry); offset += header->payload_size; + parsed_offset = offset; } |