-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
systemd: masked active network mount unit breaks the state of other mount units #10874
Comments
Probably related to #10872 |
As with #10872, if you replace the mount binary by a shell script, do you see the mount being created properly? |
The mount wrapper:
This is the output of a mount unit with the NFS unit unmasked:
With the NFS unit masked:
In both cases the entry is present in /proc/self/mountinfo |
I think I've found the problem in systemd's code. In src/core/mount.c, with the following call stack:
At mount_setup_existing_unit():
load_extras is set to true in this case because, with a normal NFS mount, mount_is_network() is true and mount_is_extrinsic() is false. Then:
Where mount_add_extras() calls:
Then unit_set_default_slice() calls unit_set_slice(), that evaluates the state of the unit:
In our scenario, the NFS mount point is UNIT_ACTIVE, returning a -EBUSY (-16) up to mount_setup_existing_unit(), where this is run:
Back to mount_setup_unit and mount_load_proc_self_mountinfo() where the return codes are aggregated:
And finally, in mount_dispatch_io(), the whole mount process is cancelled for all units:
I'm not yet familiar with the codebase, would it be sensible to add "u->load_state == UNIT_LOADED" to the "if (!mount_is_extrinsic(MOUNT(u)) && mount_is_network(p))" check that sets load_extras to true? |
Thanks for tracking this down, much appreciated! |
If we can't process a specific line in /proc/self/mountinfo we should log about it (which we do), but this should not affect other lines, nor further processing of mount units. Let's keep these failures local. Fixes: systemd#10874
Fix waiting in #10980 |
Just wanted to confirm that the suggested commit fixes the issue, thanks for the fix! (sorry for the delay, I've been out some time) |
systemd version the issue has been seen with
Used distribution
Expected behaviour you didn't see
Unexpected behaviour you saw
Steps to reproduce the problem
The text was updated successfully, but these errors were encountered: