1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

ExtensionImages: log explicit error when extension-release metadata does not match

When an ExtensionImages= extension-release metadata does not match, the
log messages (unless debug level is set) are pretty much incomprehensible:

systemd[463]: run-u11.service: Failed to set up mount namespacing: /run/systemd/unit-extensions/0: Stale file handle
systemd[463]: run-u11.service: Failed at step NAMESPACE spawning /usr/bin/echo: Stale file handle

Add an explicit log message if we get ESTALE from the dissect code, to
make it clear what's happening without needing to enable debugging:

systemd[463]: Failed to mount image /tmp/app3.raw, extension-release metadata does not match the lower layer's: ID=debian VERSION_ID=11 SYSEXT_LEVEL=11
This commit is contained in:
Luca Boccassi 2021-06-22 22:59:40 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 4dce1b9f05
commit db4c8a2516

View File

@ -1157,6 +1157,15 @@ static int mount_image(const MountEntry *m, const char *root_directory) {
host_os_release_id, host_os_release_version_id, host_os_release_sysext_level);
if (r == -ENOENT && m->ignore)
return 0;
if (r == -ESTALE && host_os_release_id)
return log_error_errno(r,
"Failed to mount image %s, extension-release metadata does not match the lower layer's: ID=%s%s%s%s%s",
mount_entry_source(m),
host_os_release_id,
host_os_release_version_id ? " VERSION_ID=" : "",
strempty(host_os_release_version_id),
host_os_release_sysext_level ? " SYSEXT_LEVEL=" : "",
strempty(host_os_release_sysext_level));
if (r < 0)
return log_debug_errno(r, "Failed to mount image %s on %s: %m", mount_entry_source(m), mount_entry_path(m));