storage/reflink: fsync() after resizing existing file
Ensure that the updated metadata is written to disk.
This commit is contained in:
parent
a8784df349
commit
c31d317c63
@ -378,6 +378,7 @@ def _resize_file(path, size):
|
|||||||
''' Resize an existing file. '''
|
''' Resize an existing file. '''
|
||||||
with open(path, 'rb+') as file:
|
with open(path, 'rb+') as file:
|
||||||
file.truncate(size)
|
file.truncate(size)
|
||||||
|
os.fsync(file.fileno())
|
||||||
|
|
||||||
def _create_sparse_file(path, size):
|
def _create_sparse_file(path, size):
|
||||||
''' Create an empty sparse file. '''
|
''' Create an empty sparse file. '''
|
||||||
|
Loading…
Reference in New Issue
Block a user