mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[PR #2001] [MERGED] Set mtime/ctime/atime of all objects as nanosecond #2295
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#2295
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2001
Author: @ggtakec
Created: 7/25/2022
Status: ✅ Merged
Merged: 7/28/2022
Merged by: @gaul
Base:
master← Head:fix_stattime_nanosec📝 Commits (1)
8129ea6Set mtime/ctime/atime of all objects as nanosecond📊 Changes
12 files changed (+404 additions, -172 deletions)
View changed files
📝
src/cache.cpp(+3 -21)📝
src/fdcache.cpp(+5 -5)📝
src/fdcache.h(+1 -1)📝
src/fdcache_auto.cpp(+2 -2)📝
src/fdcache_auto.h(+1 -1)📝
src/fdcache_entity.cpp(+69 -57)📝
src/fdcache_entity.h(+1 -1)📝
src/s3fs.cpp(+151 -78)📝
src/s3fs_util.cpp(+123 -0)📝
src/s3fs_util.h(+18 -0)📝
src/string_util.cpp(+2 -1)📝
test/integration-test-main.sh(+28 -5)📄 Description
Relevant Issue (if applicable)
#2000
Details
Changed the stat time of the object for testing in #2000 to nanosecond units.
However, there was a part where the time of some objects(directories) created/modified by s3fs remained time_t/timeval unit.
Some tests could fail instability because of using time as second/usec units.
This PR code changed them to nanosecond units.
As a result,
mtime/ctime/atimeof all objects created and modified by s3fs are set in nanosecond units.With the fix, I prepared some common utility functions and decided to use them.
NOTE
On macos10, we have detected that
test_mtime_filefails.The reason is that when copying a file with
cp -p, themtimeargument of thes3fs_utimenscall should pass themtimeof the original file if it is in the correct state, but this value was different.In macos10, this
mtimeis rounded down to microseconds instead of nanoseconds.I could not know how to fix this.(in the first place, it is hard to think that it can be fixed with s3fs)
Therefore, I changed the
test_mtime_filetest result scrutiny only slightly for macos.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.