Skip to content

Commit 54ebe40

Browse files
kot-begemot-ukrichardweinberger
authored andcommitted
um: Use fdatasync() when mapping the UBD FSYNC command
We do not need to update the metadata (atime, mtime, etc) on the UBD file and/or the COW file until UML exits. UBD image mtime is checked in UML only when opening the files. After that they are locked and used exclusively by a single UML instance, so there is no point wasting resources on updating metadata on every sync. We can sync data only. The host will always update mtime if a file has been modified upon closing it. Signed-off-by: Anton Ivanov <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 0b86ce2 commit 54ebe40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/um/os-Linux/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ int os_write_file(int fd, const void *buf, int len)
290290

291291
int os_sync_file(int fd)
292292
{
293-
int n = fsync(fd);
293+
int n = fdatasync(fd);
294294

295295
if (n < 0)
296296
return -errno;

0 commit comments

Comments
 (0)