Skip to content

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