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

pid1: improve logging when we encounter a path that is too long to be converted into a mount unit name #15911

Merged
merged 4 commits into from
May 29, 2020

Conversation

poettering
Copy link
Member

Prompted-by: #15221 #14294

@lgtm-com
Copy link

lgtm-com bot commented May 25, 2020

This pull request introduces 1 alert when merging 099ae81 into 15dd451 - view on LGTM.com

new alerts:

  • 1 for Comparison result is always the same

Let's be more thorough that whenever we build a unit name based on
parameters, that the result is actually a valid user name. If it isn't
fail early.

This should allows us to catch various issues earlier, in particular
when we synthesize mount units from /proc/self/mountinfo: instead of
actually attempting to allocate a mount unit we will fail much earlier
when we build the name to synthesize the unit under. Failing early is a
good thing generally.
Whenever we pick up a new line in /proc/self/mountinfo and want to
synthesize a new mount unit from it, let's say which one it is.
Moreover, downgrade the log message when we encounter a mount point with
an overly long name to LOG_WARNING, since it's generally fine to ignore
such mount points.

Also, attach a catalog entry to explain the situation further.

Prompted-By: systemd#15221
It makes sense to be able to output every officially valid path, hence
bump the variable size limit in catalog entries to 4K (i.e. PATH_MAX).
@yuwata
Copy link
Member

yuwata commented May 29, 2020

LGTM.

@rdxmb
Copy link

rdxmb commented Nov 12, 2020

Hello,

on which systemd-version will this be released?

I am using kubernetes in ubuntu 20.04 with systemd 245 (245.4-4ubuntu3) and I am getting hundreds of those warnings Failed to set up mount unit: Invalid argument. It would be interesting to which units they belong to ...

@keszybz
Copy link
Member

keszybz commented Nov 12, 2020

@rdxmb if you follow the link to fac729f, you'll see that that commit is present in v247-rc2 v247-rc1 v246 v246-rc2 v246-rc1 .

@rdxmb
Copy link

rdxmb commented Nov 12, 2020

@keszybz I see, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants