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

Linux sandbox: ignore ENODEV when making the filesystem read-only. #16172

Closed
wants to merge 1 commit into from

Conversation

cf-natali
Copy link
Contributor

@cf-natali cf-natali commented Aug 26, 2022

The code remounting existing mounts as read-only already ignores various
errors, such as EINVAL, ESTALE etc.

Unfortunately, it doesn't ignore ENODEV, which can occur in case of
autofs/automount failure.
Currently, having a single broken automount on the host can cause all
sandboxes to fail with the following error:

src/main/tools/linux-sandbox-pid1.cc:281: "remount(nullptr,
/data/foo, nullptr, 2101281, nullptr)": No such device

So simply also add ENODEV to the list of errors ignored.

The code remounting existing mounts as read-only already ignores various
errors, such as `EINVAL`, `ESTALE` etc.

Unfortunately, it doesn't ignore `ENODEV`, which can occur in case of
`autofs`/`automount` failure.
Currently, having a single broken automount on the host can cause all
sandboxes to fail with the following error:

```
src/main/tools/linux-sandbox-pid1.cc:281: "remount(nullptr,
/data/foo, nullptr, 2101281, nullptr)": No such device
```

So simply also add `ENODEV` to the list of errors ignored.
@cf-natali cf-natali force-pushed the linux-sandbox-enodev branch from c030af2 to cd19bec Compare August 26, 2022 19:32
@sgowroji sgowroji added team-Local-Exec Issues and PRs for the Execution (Local) team awaiting-review PR is awaiting review from an assigned reviewer labels Aug 29, 2022
@ShreeM01 ShreeM01 removed the awaiting-review PR is awaiting review from an assigned reviewer label Sep 15, 2022
aiuto pushed a commit to aiuto/bazel that referenced this pull request Oct 12, 2022
The code remounting existing mounts as read-only already ignores various
errors, such as `EINVAL`, `ESTALE` etc.

Unfortunately, it doesn't ignore `ENODEV`, which can occur in case of
`autofs`/`automount` failure.
Currently, having a single broken automount on the host can cause all
sandboxes to fail with the following error:

```
src/main/tools/linux-sandbox-pid1.cc:281: "remount(nullptr,
/data/foo, nullptr, 2101281, nullptr)": No such device
```

So simply also add `ENODEV` to the list of errors ignored.

Closes bazelbuild#16172.

PiperOrigin-RevId: 470953318
Change-Id: Ib737d94051fe7507a5e1f6fa01f367690429c47a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Local-Exec Issues and PRs for the Execution (Local) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants