fsimpl/gofer/tmpfs: Support statx btime#13038
Open
tanyifeng wants to merge 1 commit into
Open
Conversation
608a874 to
55435a4
Compare
Collaborator
|
Curious, which workload is this impacting? |
Contributor
Author
The dependency is from tokio-rs/tracing: Specifically, test_max_log_files uses The pruning code depends on file creation time here: let created = metadata.created().ok()?;On Linux, Rust's panic!("this file should have been pruned already!"); |
ayushr2
reviewed
May 4, 2026
0aaf7b2 to
1a06b7b
Compare
ayushr2
reviewed
May 22, 2026
gVisor did not report valid statx btime: gofer/directfs used fstat(2), which has no btime, and tmpfs did not track creation time. Use host statx(AT_EMPTY_PATH) for gofer/directfs metadata. Restrict host statx in gofer/sandbox seccomp filters to FD-only calls using a fixed empty path and AT_EMPTY_PATH. Track optional STATX_BTIME availability so filesystems without btime support do not expose zero btime. For tmpfs, initialize btime at inode creation and report STATX_BTIME, matching Linux >= 5.18. Reference: fs/stat.c:vfs_statx(), mm/shmem.c:shmem_getattr() Signed-off-by: Tan Yifeng <yiftan@tencent.com>
1a06b7b to
4c56998
Compare
ayushr2
approved these changes
May 26, 2026
ayushr2
reviewed
May 26, 2026
Collaborator
There was a problem hiding this comment.
FYI I imported this and fixed some things:
- directfs was missing btime update on revalidation and restore paths (lisafs was updating it correctly)
- changed
directfsInode.updateMetadataFromStatLocked()=>updateMetadataFromStatxLocked()and updated it to be same aslisafsInode.updateMetadataFromStatxLocked()implementation. - Deleted
dentryTimestampFromStatxand just updateddentryTimestampFromUnixto use unix.Statx_t and updated all callsites. - Fixed
newDirectfsDentry()to checkunix.Statx_t.Maskfield and accordingly initialize the dentry fields, analogous tonewLisafsDentry(). - Some minor cosmetic changes.
Will submit that change and retain your authorship on that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gVisor did not report valid statx btime: gofer/directfs used fstat(2), which has no btime, and tmpfs did not track creation time.
Use host statx(AT_EMPTY_PATH) for gofer/directfs metadata. Restrict host statx in gofer/sandbox seccomp filters to FD-only calls using a fixed empty path and AT_EMPTY_PATH.
Track optional STATX_BTIME availability so filesystems without btime support do not expose zero btime. For tmpfs, initialize btime at inode creation and report STATX_BTIME, matching Linux >= 5.18.
Reference: fs/stat.c:vfs_statx(), mm/shmem.c:shmem_getattr()