From c31d317c6349ae6f2a54f4ce8cad80cc1517dcfc Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Sun, 11 Mar 2018 15:34:55 +0000 Subject: [PATCH] storage/reflink: fsync() after resizing existing file Ensure that the updated metadata is written to disk. --- qubes/storage/reflink.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qubes/storage/reflink.py b/qubes/storage/reflink.py index 7cb9ca10..cc3a5db1 100644 --- a/qubes/storage/reflink.py +++ b/qubes/storage/reflink.py @@ -378,6 +378,7 @@ def _resize_file(path, size): ''' Resize an existing file. ''' with open(path, 'rb+') as file: file.truncate(size) + os.fsync(file.fileno()) def _create_sparse_file(path, size): ''' Create an empty sparse file. '''