util/fossilize_db: Flush files after header write.

We should probably flush before we unlock the file again.

Fixes: 4f0f8133a3 "util/fossilize_db: Do not lock the fossilize db permanently."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>
(cherry picked from commit 3091277052)
This commit is contained in:
Bas Nieuwenhuizen 2021-08-05 01:29:04 +02:00 committed by Dylan Baker
parent 15df61065d
commit b2d326fba1
2 changed files with 4 additions and 1 deletions

View file

@ -607,7 +607,7 @@
"description": "util/fossilize_db: Flush files after header write.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "4f0f8133a35ec2fec8d99936cd7425e40d092169"
},

View file

@ -241,6 +241,9 @@ load_foz_dbs(struct foz_db *foz_db, FILE *db_idx, uint8_t file_idx,
sizeof(stream_reference_magic_and_version), db_idx) !=
sizeof(stream_reference_magic_and_version))
goto fail;
fflush(foz_db->file[file_idx]);
fflush(db_idx);
}
flock(fileno(foz_db->file[file_idx]), LOCK_UN);