mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
util/fossilize_db: Pull seek into lock.
Otherwise the seek can overlap with other reads/writes. Fixes:eca6bb9540("util/fossilize_db: add basic fossilize db util to read/write shader caches") Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11485> (cherry picked from commitbd41c51c8f)
This commit is contained in:
parent
8360f0d033
commit
baf9253729
2 changed files with 4 additions and 4 deletions
|
|
@ -3352,7 +3352,7 @@
|
|||
"description": "util/fossilize_db: Pull seek into lock.",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "eca6bb9540d8d1b260511cd0a71bdddb00ff4a3c"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -362,14 +362,14 @@ foz_read_entry(struct foz_db *foz_db, const uint8_t *cache_key_160bit,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
/* Reset file offset to the end of the file ready for writing */
|
||||
fseek(foz_db->file[file_idx], offset, SEEK_SET);
|
||||
|
||||
simple_mtx_unlock(&foz_db->mtx);
|
||||
|
||||
if (size)
|
||||
*size = data_sz;
|
||||
|
||||
/* Reset file offset to the end of the file ready for writing */
|
||||
fseek(foz_db->file[file_idx], offset, SEEK_SET);
|
||||
|
||||
return data;
|
||||
|
||||
fail:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue