Mesa (main): util/fossilize_db: Flush files after header write.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Aug 7 20:40:22 UTC 2021


Module: Mesa
Branch: main
Commit: 3091277052cccd47994a2aa075eecaa767cc709b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3091277052cccd47994a2aa075eecaa767cc709b

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Thu Aug  5 01:29:04 2021 +0200

util/fossilize_db: Flush files after header write.

We should probably flush before we unlock the file again.

Fixes: 4f0f8133a35 "util/fossilize_db: Do not lock the fossilize db permanently."
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>

---

 src/util/fossilize_db.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/fossilize_db.c b/src/util/fossilize_db.c
index 6737cf2b21b..af5c6e58581 100644
--- a/src/util/fossilize_db.c
+++ b/src/util/fossilize_db.c
@@ -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);



More information about the mesa-commit mailing list