-
Notifications
You must be signed in to change notification settings - Fork 157
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
Support open with O_RDWR flag #370
Conversation
request: UploadState::InProgress(request).into(), | ||
handle, | ||
}, | ||
let remote_file = lookup.inode.is_remote()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably log here which option we're choosing for this O_RDWR
file
@@ -58,7 +58,7 @@ Mountpoint for Amazon S3 intentionally does not support all POSIX file system op | |||
#### Reads | |||
|
|||
Basic read-only operations are fully supported, including both sequential and random reads: | |||
* `open`, `openat`, in read-only mode (`O_RDONLY`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should mention that O_RDWR
will work but you can't both read and write to the same fd
Currently, Mountpoint supports either open with O_WRONLY or O_RDONLY because we don't allow applications to do both read and write at the same time. However, it's possible support O_RDWR flag too since we can decide at open time whether to give a read handle or a write handle back, and for any inode it's never possible for both start_reading and start_writing to work. Signed-off-by: Monthon Klongklaew <monthonk@amazon.com>
Signed-off-by: Monthon Klongklaew <monthonk@amazon.com>
Co-authored-by: James Bornholt <jamesbornholt@gmail.com> Signed-off-by: Monthon Klongklaew <monthonk@amazon.com>
Signed-off-by: Monthon Klongklaew <monthonk@amazon.com>
Description of change
Currently, Mountpoint supports either open with
O_WRONLY
orO_RDONLY
because we don't allow applications to do both read and write at the same time. However, it's possible supportO_RDWR
flag too since we can decide at open time whether to give a read handle or a write handle back, and for any inode it's never possible for both start_reading and start_writing to work.Does this change impact existing behavior?
No
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).