Skip to content

ptfs: refine the way to support O_DIRECT#176

Open
jiangliu wants to merge 2 commits intocloud-hypervisor:masterfrom
jiangliu:ensure-flags
Open

ptfs: refine the way to support O_DIRECT#176
jiangliu wants to merge 2 commits intocloud-hypervisor:masterfrom
jiangliu:ensure-flags

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 <gerry@linux.alibaba.com>
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 <gerry@linux.alibaba.com>
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