From ce8d8195dc253a87cceaaeeb1a725090471ae4f8 Mon Sep 17 00:00:00 2001 From: Niklas Hambüchen Date: Sat, 18 Feb 2017 00:49:02 +0100 Subject: posix: use nanosecond accuracy when available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Programs that set mtime, such as `rsync -a`, don't work correctly on GlusterFS, because it sets the nanoseconds to 000. This creates problems for incremental backups, where files get accidentally copied again and again. For example, consider `myfile` on an ext4 system, being copied to a GlusterFS volume, with `rsync -a` and then `cp -u` in turn. You'd expect that after the first `rsync -a`, `cp -u` agrees that the file need not be copied. BUG: 1422074 Change-Id: I89c7b6a73e2e06c02851ff76b7e5cdfaa271e985 Signed-off-by: Niklas Hambüchen Reviewed-on: https://review.gluster.org/16667 Smoke: Gluster Build System Reviewed-by: Niels de Vos Tested-by: Jeff Darcy NetBSD-regression: NetBSD Build System Reviewed-by: jiffin tony Thottan CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- libglusterfs/src/syscall.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libglusterfs/src/syscall.h') diff --git a/libglusterfs/src/syscall.h b/libglusterfs/src/syscall.h index b1bcad138c5..6bb374822ee 100644 --- a/libglusterfs/src/syscall.h +++ b/libglusterfs/src/syscall.h @@ -129,6 +129,12 @@ sys_ftruncate (int fd, off_t length); int sys_utimes (const char *filename, const struct timeval times[2]); +#if defined(HAVE_UTIMENSAT) +int +sys_utimensat (int dirfd, const char *filename, const struct timespec times[2], + int flags); +#endif + int sys_creat (const char *pathname, mode_t mode); -- cgit