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

ptfs: refine the way to support O_DIRECT #176

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jiangliu
Copy link
Contributor

We have special support of the O_DIRECT flag, but the implementation has race conditions due to Time To Check & Time To Use issues. So refine the implementation by using a RwLock.

We have special support of the O_DIRECT flag, but the implementation
has race conditions due to `Time To Check & Time To Use` issues.
So refine the implementation by using a RwLock.

Signed-off-by: Jiang Liu <[email protected]>
If error happens between File::from_raw_fd() and ManuallyDrop::new(),
the underlying fd will be closed unexpectedly. Fix it by introducing
a helper to ensure atomicity.

Signed-off-by: Jiang Liu <[email protected]>
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.

1 participant