summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-10-03 22:59:52 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-10-03 22:59:52 +0200
commitfcb3204dcd433c3fbda3a0cca45cab935aacdb4a (patch)
treedc89cf367d92ce5bcd9a1cfa00840ae893c4cf22
parentda5b44eaf131c748caeedf59b3dc9e42b94c82f0 (diff)
libdiskfs: Make relatime also update atime when equal to mtime/ctime
Some tests (such as glibc's tst-atime) require it for instance. * libdiskfs/node-times.c (atime_should_update): Also return 1 when atime is equal to mtime or ctime.
-rw-r--r--libdiskfs/node-times.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdiskfs/node-times.c b/libdiskfs/node-times.c
index 05f558be..60eabc0f 100644
--- a/libdiskfs/node-times.c
+++ b/libdiskfs/node-times.c
@@ -40,10 +40,10 @@ atime_should_update (struct node *np)
if (_diskfs_relatime)
{
/* Update atime if mtime is younger than atime. */
- if (np->dn_stat.st_mtim.tv_sec > np->dn_stat.st_atim.tv_sec)
+ if (np->dn_stat.st_mtim.tv_sec >= np->dn_stat.st_atim.tv_sec)
return 1;
/* Update atime if ctime is younger than atime. */
- if (np->dn_stat.st_ctim.tv_sec > np->dn_stat.st_atim.tv_sec)
+ if (np->dn_stat.st_ctim.tv_sec >= np->dn_stat.st_atim.tv_sec)
return 1;
/* Update atime if current atime is more than 24 hours old. */
maptime_read (diskfs_mtime, &t);