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

Support open with O_RDWR flag #370

Merged
merged 5 commits into from
Jul 17, 2023
Merged

Support open with O_RDWR flag #370

merged 5 commits into from
Jul 17, 2023

Conversation

monthonk
Copy link
Contributor

Description of change

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.

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).

@monthonk monthonk temporarily deployed to PR integration tests July 13, 2023 12:57 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 13, 2023 12:57 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 13, 2023 12:57 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 13, 2023 12:57 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 13, 2023 13:07 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 13, 2023 13:07 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 13, 2023 13:07 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 13, 2023 13:07 — with GitHub Actions Inactive
@monthonk monthonk had a problem deploying to PR integration tests July 13, 2023 16:56 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests July 13, 2023 16:56 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests July 13, 2023 16:56 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests July 13, 2023 16:56 — with GitHub Actions Failure
request: UploadState::InProgress(request).into(),
handle,
},
let remote_file = lookup.inode.is_remote()?;
Copy link
Member

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

mountpoint-s3/tests/fuse_tests/write_test.rs Outdated Show resolved Hide resolved
@monthonk monthonk had a problem deploying to PR integration tests July 14, 2023 09:14 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests July 14, 2023 09:14 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests July 14, 2023 09:14 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests July 14, 2023 09:14 — with GitHub Actions Failure
@monthonk monthonk temporarily deployed to PR integration tests July 14, 2023 09:37 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 14, 2023 09:37 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 14, 2023 09:37 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 14, 2023 09:37 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 14, 2023 09:39 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 14, 2023 09:39 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 14, 2023 09:39 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 14, 2023 09:39 — with GitHub Actions Inactive
@@ -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`)
Copy link
Member

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

@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 10:53 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 10:53 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 10:53 — with GitHub Actions Inactive
monthonk and others added 5 commits July 17, 2023 12:21
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>
Signed-off-by: Monthon Klongklaew <monthonk@amazon.com>
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 12:22 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 12:22 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 12:22 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 14:41 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 14:41 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 14:41 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests July 17, 2023 14:41 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt merged commit 0efc380 into awslabs:main Jul 17, 2023
16 checks passed
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.

2 participants