Skip to content
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

Merged
merged 3 commits into from
Jul 21, 2023

Conversation

monthonk
Copy link
Contributor

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).

@monthonk monthonk temporarily deployed to PR integration tests July 19, 2023 13:17 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 19, 2023 13:17 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 19, 2023 13:17 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 19, 2023 13:17 — with GitHub Actions Inactive
Comment on lines +207 to +211
// 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));
}
Copy link
Contributor Author

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.

doc/SEMANTICS.md Outdated Show resolved Hide resolved
monthonk and others added 2 commits July 20, 2023 14:51
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>
passaro
passaro previously approved these changes Jul 20, 2023
Copy link
Contributor

@passaro passaro left a 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>
@monthonk monthonk temporarily deployed to PR integration tests July 20, 2023 15:08 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 20, 2023 15:08 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 20, 2023 15:08 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 20, 2023 15:08 — with GitHub Actions Inactive
@monthonk monthonk added this pull request to the merge queue Jul 21, 2023
Merged via the queue into awslabs:main with commit 183a20c Jul 21, 2023
16 checks passed
@monthonk monthonk deleted the setattr branch July 21, 2023 09:35
@monthonk monthonk mentioned this pull request Jul 24, 2023
@jamesbornholt jamesbornholt mentioned this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants