-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mfu: add --open-noatime to open files with O_NOATIME #561
Conversation
@daltonbohning , I hope you're doing well. We've had some requests to add Is there someone who can help us check that? |
Hey Adam. Yes, I'm doing well. Hope the same for you! It looks like DAOS/DFS doesn't respect passing Thanks for the heads up! |
DAOS JIRA for reference: https://daosio.atlassian.net/browse/DAOS-14479 |
We discussed this in the context of DAOS, and we don't actually store atime with the file. It's only populated in the stat buf to the greater of mtime or ctime. So handling O_NOATIME wouldn't help anything because it would just get "reset" on the next file open. |
TODO: we'll need to be a bit more clever when copying files that are readable but not owned by the user. From
and potential error:
|
Thanks, @daltonbohning . And thanks for your super fast response! |
It sounds like https://www.gnu.org/software/tar/manual/html_section/Attributes.html
|
For the ability to use mpifileutils/src/common/mfu_flist_chmod.c Lines 1258 to 1260 in 4791815
mpifileutils/src/common/mfu_flist_chmod.c Lines 1286 to 1296 in 4791815
mpifileutils/src/common/mfu_flist_chmod.c Lines 1069 to 1075 in 4791815
TODO: this code doesn't really accomplish what it claims to do. I'll fix that later. |
Apparently, rsync v3.2.0 provides the following options for atime: https://download.samba.org/pub/rsync/rsync.1
Tip from: https://unix.stackexchange.com/questions/630228/rsync-keep-access-time-atime-how |
Signed-off-by: Adam Moody <moody20@llnl.gov>
This adds an
--open-noatime
option to a number of tools, which adds theO_NOATIME
flag when opening files to avoid updating the file last access time.Many centers use last access time to filter files for purge operations, and they would prefer not to change file atime values when making backup copies with
dsync
or scanning the file system for duplicate files withddup
. Adding this flag may also improve read performance on some file systems.The
O_NOATIME
flag is only allowed when the effective user id matches the owner of the file or when the process is running with theCAP_FOWNER
capability. A normal user will encounter errors when usingO_NOATIME
when reading from a shared directory containing files owned by other users, even if the current user has read access to all files.The following tools are affected:
ddup
- when reading files to compute hash valuesdcp
anddsync
- when reading source files during a copydcmp
anddsync
- when reading source and destination files while comparing their contentsdtar
- while reading source files when creating an archiveWheen
--open-noatime
is specified withddup
, the tool checks the owner user id of each file and conditionally addsO_NOATIME
if the process effective user id matches. This allows normal users to specify the--open-noatime
option, even when runningddup
on files that they don't own. The atime will be updated on files that the user can read but does not own.For the remaining tools, the current algorithms do not expose the file owner id in a way to allow for an easy check. In this case,
O_NOATIME
is added when opening all files. Normal users will thus encounter an error if the tool attempts to open any file that they do not own.Resolves:
#557
#534