imagecache: fall back to legacy mount on pre-6.5 kernels - #504
imagecache: fall back to legacy mount on pre-6.5 kernels#504Mesut Oezdil (mesutoezdil) wants to merge 1 commit into
Conversation
Benjamin Elder (BenTheElder)
left a comment
There was a problem hiding this comment.
description is out of date.
agentic review pass (human reviewed before submission) comments inline
|
Please prefer rebase to merge, and squash these, so the commit message will be useful. we started using volatile, which may have bumped up the requirements, but its load bearing and I don't think we're targeting old kernels cc igooch |
7a43e8a to
8f58ea3
Compare
|
Benjamin Elder (@BenTheElder) thx, squashed into one commit. On volatile: it landed in Linux 5.10, older than the 6.5 this PR already requires for lowerdir+, so it does not raise the floor past what is here. The code only sets the plain volatile flag too, not the later reusable-remount behavior. Whether the project still wants to support pre-6.5 kernels at all is a separate call, happy to close this if not. |
39e03d5 to
b580330
Compare
SetupBundleRootfs mounts overlay rootfs with the new mount API using fsconfig lowerdir+ per layer, which only exists on Linux 6.5+. On older kernels every actor mount failed with a bare EINVAL, which looked like flakiness rather than a kernel version problem. mountOverlay now tries lowerdir+ on the first layer. If the kernel does not recognize it, that call fails immediately with an Unknown parameter diagnostic on the fs context log, and only that specific diagnostic triggers a fallback to a plain mount(2) call built from the same lowerdir list. A bad lowerdir path still fails as-is instead of being misread as a kernel version problem. The legacy path keeps the old about 34 layer cap and errors with a kernel hint if the option string would go over the mount(2) page limit. Fixes agent-substrate#500
b580330 to
852b0b8
Compare
Fixes #500.
SetupBundleRootfs mounts overlay rootfs with the new mount API,
using fsconfig lowerdir+ per layer. That option only exists on
Linux 6.5+. On older kernels every actor mount fails with a bare
EINVAL, which looks like flakiness, not a kernel version problem.
Fix: mountOverlay tries lowerdir+ directly on the first layer. If
the kernel does not recognize it, that call fails immediately and
queues "Unknown parameter" on the fs context log; only that specific
diagnostic triggers the fallback to a plain mount(2) call built from
the same lowerdir list, so a bad lowerdir path (ENOENT) is reported
as-is instead of being misread as a kernel version problem. The
legacy path keeps the old ~34 layer cap and errors with a kernel
hint if the option string would go over the mount(2) page limit.
Tested with go test ./internal/imagecache/... on a real Linux
kernel (root, CAP_SYS_ADMIN, tmpfs upperdir), including a test that
forces the fallback with an unrecognized option name and one for
the option string builder.