allow O_NOATIME | O_PATH open(2) flags?

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

 



Hi,

It does not currently appear possible for a userland application to
read a symbolic link without disturbing said link's access time.
(unless of course the fs was mounted with -o ro or -o noatime). I had
tried to use readlinkat(2) on a file descriptor opened with O_PATH |
O_NOATIME before discovering I had missed this clause in the open(2)
manpage: "When O_PATH is specified in flags, flag bits other than
O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW are ignored."

I see the other flag bits appear to get stripped off here:

fs/open.c:build_open_flags()
...
         } else if (flags & O_PATH) {
                 /*
                  * If we have O_PATH in the open flag. Then we
                  * cannot have anything other than the below set of flags
                  */
                 flags &= O_DIRECTORY | O_NOFOLLOW | O_PATH;
                 acc_mode = 0;
         }
...

My questions are:

1. Was there an explicit intent to prevent O_PATH from being used in
conjunction with O_NOATIME or was this combination just an
unanticipated use case?

2. Would there be objections to a patch allowing O_NOATIME to be used
in combination with O_PATH?

Thank you,

-Mike Brown



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux