storage/reflink: fsync() after resizing existing file

Ensure that the updated metadata is written to disk.
This commit is contained in:
Rusty Bird 2018-03-11 15:34:55 +00:00
parent a8784df349
commit c31d317c63
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -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. '''