diff options
author | Anton Ivanov <anton.ivanov@cambridgegreys.com> | 2020-04-22 17:00:01 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2020-06-02 22:37:55 +0200 |
commit | 54ebe4060fe6c4ab76c79354417612ac9cf4f95e (patch) | |
tree | ceb6f5e538059b73ee13c52afe22fb4b8276cfbe /arch/um/os-Linux/file.c | |
parent | 0b86ce29cfc273501d019b18f31cee7837c8fd2a (diff) | |
download | linux-54ebe4060fe6c4ab76c79354417612ac9cf4f95e.tar.gz linux-54ebe4060fe6c4ab76c79354417612ac9cf4f95e.tar.bz2 linux-54ebe4060fe6c4ab76c79354417612ac9cf4f95e.zip |
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 <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/os-Linux/file.c')
-rw-r--r-- | arch/um/os-Linux/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index 044836ad7392..e4421dbc4c36 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c @@ -290,7 +290,7 @@ int os_write_file(int fd, const void *buf, int len) int os_sync_file(int fd) { - int n = fsync(fd); + int n = fdatasync(fd); if (n < 0) return -errno; |