From 47e2d5c4153148ba9e5a033f53866557ab6f23d9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 16 Mar 2020 18:20:16 +0000 Subject: [PATCH] config: fsync the config file after writing #3411 This should help with data integrity --- fs/config/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/config/config.go b/fs/config/config.go index c7793f412..53d67ef03 100644 --- a/fs/config/config.go +++ b/fs/config/config.go @@ -558,6 +558,7 @@ func saveConfig() error { _ = enc.Close() } + _ = f.Sync() err = f.Close() if err != nil { return errors.Errorf("Failed to close config file: %v", err)