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

Posix adapter shouldn't rely on O_TMPFILE support #389

Merged
merged 1 commit into from
Mar 25, 2022

Conversation

ChristopherHogan
Copy link
Collaborator

Kernel versions < 3.11 and certain filesystems (e.g., lustre) don't support the O_TMPFILE flag to open. The flag is used in two ways in the POSIX adapter.

  1. Hermes must treat an open with O_TMPFILE like an open with O_CREAT, since both should result in the creation of a Bucket.
if (flags & O_CREAT || flags & O_TMPFILE) {
  // ...
}
  1. The POSIX adapter tests create temporary files with O_TMPFILE to test Hermes' handling of the flag.

To fix 1), I define O_TMPFILE to 0 if it's not defined. To fix 2), I only run the O_TMPFILE tests after verifying that the kernel and filesystem both support O_TMPFILE.

@ChristopherHogan ChristopherHogan added bug Something isn't working portability Cross-system sanity adapter-posix Related to the POSIX adapter labels Mar 25, 2022
@ChristopherHogan ChristopherHogan self-assigned this Mar 25, 2022
Copy link
Member

@hyoklee hyoklee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 81.583% when pulling a284e5a on chogan/tmpfile into 4fac80a on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapter-posix Related to the POSIX adapter bug Something isn't working portability Cross-system sanity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants