[Top][All Lists]

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

[bug #33724] Find command is changing the access time of directory

From: Bernhard Voelker
Subject: [bug #33724] Find command is changing the access time of directory
Date: Fri, 28 Sep 2018 22:08:48 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Follow-up Comment #3, bug #33724 (project findutils):

[CC-ing gnulib, in the hope they see the attachment as well.]

On Sun 01 Nov 2015 11:19:53 PM CET, James Youngman wrote:
> It looks like the FTS_NOATIME flag does what's needed.

Not quite: openat() returns with EPERM if:

  $ man openat | grep EPERM.*NOATIME
       EPERM  The O_NOATIME flag was specified, but the effective user ID of
the caller \
              did not match the owner of the file and the caller was not

Indeed, when quickly adding FTS_NOATIME to ftsoptions in ftsfind.c for
then strace in a directory not owned by the calling (non-root) user shows:

  openat(AT_FDCWD, ".",
EPERM (Operation not permitted)

and find issues an error diagnostic.

It seems that O_NOATIME cannot be used generally on directories.
Conversely it seems that the atime of such a directory is changed
without a problem.

The attached path makes FTS retry without O_NOATIME in such a case
which seems to be the best choice we currently have.
Once this is working in FTS, we need to decide how to enable/disable
the NOATIME behaviour in find(1), as POSIX requires this per default.


Have a nice day,

(file #45115)

Additional Item Attachment:

File name: 0001-fts-opendirat-fall-back-to-O_NOATIME-in-case-of-EPER.patch
Size:2 KB


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]