-
Notifications
You must be signed in to change notification settings - Fork 157
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
Implement setattr to support changing time attributes #391
Conversation
// Should be impossible since local file stat never expire. | ||
if !sync.stat.is_valid() { | ||
warn!(?ino, "local inode stat already expired"); | ||
return Err(InodeError::SetAttrOnExpiredStat(ino)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure how we should handle this case, another option is doing lookup to update the validity, but it should not happen so I think it makes sense to return an error immediately.
Some applications like `touch` requires the file system to support changing file last access and modification times. We don't support this operation because the last modification time for objects can't be set via S3 API. However, it's possible to allow this only for the files that are being written because at that time it's still a temporary stat in Mountpoint. Signed-off-by: Monthon Klongklaew <monthonk@amazon.com>
Co-authored-by: Alessandro Passaro <alessandro.passaro@gmail.com> Signed-off-by: Monthon Klongklaew <monthonk@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Monthon Klongklaew <monthonk@amazon.com>
Description of change
Some applications like
touch
requires the file system to support changing file last access and modification times. We don't support this operation because the last modification time for objects can't be set via S3 API. However, it's possible to allow this only for the files that are being written because at that time it's still a temporary stat in Mountpoint.Relevant issues: #358
Does this change impact existing behavior?
Yes,
setattr
will now work for the files that are being written.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).