Po głębszym przyjrzeniu się problemowi okazało się, że także u mnie zarówno fileatime, jak i stat zachowują się, delikatnie mówiąc, dziwnie. W związku z tym zacząłem zgłębiać temat, przy czym ograniczyłem się do Linuksa (co nie powinno być problemem, bo większość hostingów i vpsów to jakiś tam Linux).
Okazało się, że za taki "dziwny" stan rzeczy (taki jak Ty opisujesz, jak i taki jak ja zauważyłem), odpowiada... kernel Linuksa. Niemniej, da się go przekonać, by działał tak jak trzeba. Ale po kolei. Mając filesystem zamontowany z domyślnymi opcjami działa to jak w opisie. Domyślne opcje to u mnie (z /proc/mounts):
Kod
/[device] /[mountpoint] ext3 rw,relatime,errors=continue,data=ordered 0 0
Wczytując się w manual do atime, znalazłem:
Kod
atime Update inode access time for each access. See also the stricta-
time mount option.
noatime
Do not update inode access times on this filesystem (e.g, for
faster access on the news spool to speed up news servers).
relatime
Update inode access times relative to modify or change time.
Access time is only updated if the previous access time was ear-
lier than the current modify or change time. (Similar to noat-
ime, but doesn't break mutt or other applications that need to
know if a file has been read since the last time it was modi-
fied.)
norelatime
Do not use relatime feature. See also the strictatime mount
option.
strictatime
Allows to explicitly requesting full atime updates. This makes
it possible for kernel to defaults to relatime or noatime but
still allow userspace to override it. For more details about the
default system mount options see /proc/mounts.
nostrictatime
Use the kernel's default behaviour for inode access time
updates.
Rozwiązaniem jest przemontowanie filesystemu z opcją "strictatime":
Kod
mount -o remount,strictatime [device|katalog]
U mnie pomogło, a efekt w /proc/mounts jest taki, że zniknęło
"relatime":
Kod
/[device] /[mountpoint] ext3 rw,errors=continue,data=ordered 0 0
Potestuj.