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

Explicitly prevent mounting over an existing mount #348

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

jamesbornholt
Copy link
Member

@jamesbornholt jamesbornholt commented Jun 30, 2023

Description of change

It's valid to mount multiple file systems to the same directory, but
doing so requires the first one to be mounted read-write, which is why
this wasn't a problem for us until #327. It seems libfuse2's version of
fusermount explicitly checked this(?), but libfuse3 no longer rejects
it.

In principle this might be something we'd want to allow, but I think the
less surprising/error-prone customer experience is to refuse to do it,
so let's explicitly forbid it.

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

@@ -251,14 +251,6 @@ impl CliArgs {
fn main() -> anyhow::Result<()> {
let args = CliArgs::parse();

// validate mount point
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we okay moving this validation to the background process?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be -- it was the only validation we were doing in the foreground process previously, and we shouldn't be doing any work at all before the fork.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, but we need to update the tests.

@jamesbornholt jamesbornholt temporarily deployed to PR integration tests June 30, 2023 16:36 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests June 30, 2023 16:36 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests June 30, 2023 16:36 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests June 30, 2023 16:36 — with GitHub Actions Inactive
@@ -31,6 +31,7 @@ time = { version = "0.3.17", features = ["macros", "formatting"] }
const_format = "0.2.30"
home = "0.5.4"
serde_json = "1.0.95"
procfs = { version = "0.15.1", default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this platform-specific?

@passaro passaro marked this pull request as ready for review June 30, 2023 17:19
It's valid to mount multiple file systems to the same directory, but
doing so requires the first one to be mounted read-write, which is why
this wasn't a problem for us until awslabs#327. It seems libfuse2's version of
fusermount explicitly checked this(?), but libfuse3 no longer rejects
it.

In principle this might be something we'd want to allow, but I think the
less surprising/error-prone customer experience is to refuse to do it,
so let's explicitly forbid it.

Signed-off-by: James Bornholt <[email protected]>
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests June 30, 2023 17:26 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests June 30, 2023 17:26 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests June 30, 2023 17:26 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests June 30, 2023 17:26 — with GitHub Actions Inactive
@passaro passaro merged commit 15b0628 into awslabs:main Jun 30, 2023
16 checks passed
@jamesbornholt jamesbornholt deleted the forbid-double-mount branch June 30, 2023 17:48
sauraank pushed a commit to sauraank/mountpoint-s3 that referenced this pull request Jul 3, 2023
It's valid to mount multiple file systems to the same directory, but
doing so requires the first one to be mounted read-write, which is why
this wasn't a problem for us until awslabs#327. It seems libfuse2's version of
fusermount explicitly checked this(?), but libfuse3 no longer rejects
it.

In principle this might be something we'd want to allow, but I think the
less surprising/error-prone customer experience is to refuse to do it,
so let's explicitly forbid it.

Signed-off-by: James Bornholt <[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.

2 participants