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

Show a better error message for mount(2) -> ENOSPC #615

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

smcv
Copy link
Collaborator

@smcv smcv commented Jan 3, 2024

cc @RyuzakiKK

This lets die_with_error() reuse it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
mount(2) uses ENOSPC to represent an arbitrary anti-denial-of-service
limit being exceeded, which is outside the usual meaning of
"No space left on device". We can make this clearer by catching that
particular failure mode and giving users a hint.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=218336
Resolves: ValveSoftware/steam-runtime#637
Signed-off-by: Simon McVittie <smcv@collabora.com>
@smcv
Copy link
Collaborator Author

smcv commented Jan 3, 2024

(Prior art: https://sourceforge.net/projects/libexplain/, but that doesn't seem to be actively maintained, and doesn't know that mount(2) can fail with ENOSPC.)

* errno value to mean something more like "limit exceeded". */
return ("Limit exceeded (ENOSPC). "
"(Hint: Check that /proc/sys/fs/mount-max is sufficient, "
"typically 100000)");
Copy link
Contributor

@RyuzakiKK RyuzakiKK Jan 29, 2024

Choose a reason for hiding this comment

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

I was unsure if "typically" here meant that the default value was supposed to be 100k or if instead that was a common suggested large enough number to use.

And just FTR, proc(5) says that the former is true. 100k is the default value.

Copy link
Contributor

@RyuzakiKK RyuzakiKK left a comment

Choose a reason for hiding this comment

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

I'm not a maintainer, but looks good to me.

@smcv smcv merged commit 4872aef into containers:main Jan 29, 2024
5 checks passed
smcv added a commit to smcv/flatpak that referenced this pull request Mar 27, 2024
* `--symlink` is now idempotent, meaning it succeeds if the
  symlink already exists and already has the desired target
  (containers/bubblewrap#549, flatpak#2387,
  flatpak#3477, flatpak#5255)
* Report a better error message if `mount(2)` fails with `ENOSPC`
  (containers/bubblewrap#615, ValveSoftware/steam-runtime#637)
* Fix a double-close on error reading from `--args`, `--seccomp` or
  `--add-seccomp-fd` argument (containers/bubblewrap#558)
* Improve memory allocation behaviour
  (containers/bubblewrap#556, containers/bubblewrap#624)
* Silence various compiler warnings (containers/bubblewrap#559)

Resolves: flatpak#2387
Resolves: flatpak#3477
Resolves: flatpak#5255
Signed-off-by: Simon McVittie <smcv@collabora.com>
smcv added a commit to flatpak/flatpak that referenced this pull request Mar 27, 2024
* `--symlink` is now idempotent, meaning it succeeds if the
  symlink already exists and already has the desired target
  (containers/bubblewrap#549, #2387,
  #3477, #5255)
* Report a better error message if `mount(2)` fails with `ENOSPC`
  (containers/bubblewrap#615, ValveSoftware/steam-runtime#637)
* Fix a double-close on error reading from `--args`, `--seccomp` or
  `--add-seccomp-fd` argument (containers/bubblewrap#558)
* Improve memory allocation behaviour
  (containers/bubblewrap#556, containers/bubblewrap#624)
* Silence various compiler warnings (containers/bubblewrap#559)

Resolves: #2387
Resolves: #3477
Resolves: #5255
Signed-off-by: Simon McVittie <smcv@collabora.com>
GeorgesStavracas pushed a commit to GeorgesStavracas/flatpak that referenced this pull request Apr 26, 2024
* `--symlink` is now idempotent, meaning it succeeds if the
  symlink already exists and already has the desired target
  (containers/bubblewrap#549, flatpak#2387,
  flatpak#3477, flatpak#5255)
* Report a better error message if `mount(2)` fails with `ENOSPC`
  (containers/bubblewrap#615, ValveSoftware/steam-runtime#637)
* Fix a double-close on error reading from `--args`, `--seccomp` or
  `--add-seccomp-fd` argument (containers/bubblewrap#558)
* Improve memory allocation behaviour
  (containers/bubblewrap#556, containers/bubblewrap#624)
* Silence various compiler warnings (containers/bubblewrap#559)

Resolves: flatpak#2387
Resolves: flatpak#3477
Resolves: flatpak#5255
Signed-off-by: Simon McVittie <smcv@collabora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't bind mount /oldroot/../SteamLinuxRuntime_sniper/var/.. to /newroot/.. No space left on device
2 participants