mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 02:40:11 +01: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>
This commit is contained in:
parent
a99474fae5
commit
bd41c51c8f
1 changed files with 3 additions and 3 deletions
|
|
@ -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