tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: noatime mounts inhibiting atime updates via utime()



In article <1543941318.804.8.camel%gentoo.org@localhost>,
MichaŠ Górny  <mgorny%gentoo.org@localhost> wrote:
>-=-=-=-=-=-
>
>Hello,
>
>Today me and Kamil noticed some more LLVM tests failing due to the host
>filesystem being mounted with 'noatime' option.  Upon closer
>investigation, it turned out that on NetBSD noatime inhibits not only
>implicit atime updates but also prevents the utime() family of functions
>from updating it.
>
>Is there a specific reason for this behavior?  I'm not saying it's
>incorrect (in fact, I'm pretty sure it's allowed by POSIX) but it's
>somewhat surprising and contrary to what other tested systems do (Linux,
>FreeBSD).
>
>FWIU the main purpose of using 'noatime' is to inhibit inode updates
>on file accesses and therefore avoid spurious writes.  However, I don't
>think this applies if the program sets atime explicitly; especially if
>it simultaneously updates mtime, therefore requiring an inode write
>anyway.

I think this is an artifact of the code path to update the times...
Unfortunately this seems to be handled at the filesystem level :-(
https://nxr.netbsd.org/search?q=&project=src&defs=&refs=MNT_NOATIME
Yes, I think that explicitly setting the atime using utime() should
be allowed... Perhaps we should take this opportunity to refactor the
code.

christos



Home | Main Index | Thread Index | Old Index