tree-wide: make use of fsync_directory_of_file() all over the place
Let's make use this at various places we call fsync(), to make things fully reliable, as the kernel devs suggest to first fsync() files and then fsync() the directories they are located in.
This commit is contained in:
@@ -1187,6 +1187,10 @@ int fflush_sync_and_check(FILE *f) {
|
||||
if (fsync(fileno(f)) < 0)
|
||||
return -errno;
|
||||
|
||||
r = fsync_directory_of_file(fileno(f));
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user