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-240 fails to mount squashfs again, waiting for loop0 till timeout #11342
Comments
Is the loop module loaded (and does /dev/loop0 device node exist)? |
OK, thank you, I can reproduce this (We chatted a bit on IRC). It looks like after the first mount, systemd polls for /proc/self/mountinfo and internally binds the mount unit to the loop device by updating What=. Then, any subsequent mount unit triggers will fail as a start job for device is enqueued (but the loop device can only be plugged in when something attaches image to it) so it fails each time with JOB_DEPENDENCY result. A workaround is to do systemctl daemon-reload after every such umount, but yes, this looks like a bug. In generated mount unit, What= is set to image file, but after PID1 updates it, it changes to /dev/loop0. |
The problem was introduced in a374220: we have a unit which has a fragment, and when we'd update it based on /proc/self/mountinfo, we'd say that e.g. What=/dev/loop8 has origin-fragment. This commit changes two things: - origin-fragment is changed to origin-mountinfo-implicit - when we stop a unit, mountinfo information is flushed and all deps based on it are dropped. The second step is important, because when we restart the unit, we want to notice that we have "fresh" mountinfo information. We could keep the old info around and solve this in a different way, but keeping stale information seems inelegant. Fixes systemd#11342.
The problem was introduced in a374220: we have a unit which has a fragment, and when we'd update it based on /proc/self/mountinfo, we'd say that e.g. What=/dev/loop8 has origin-fragment. This commit changes two things: - origin-fragment is changed to origin-mountinfo-implicit - when we stop a unit, mountinfo information is flushed and all deps based on it are dropped. The second step is important, because when we restart the unit, we want to notice that we have "fresh" mountinfo information. We could keep the old info around and solve this in a different way, but keeping stale information seems inelegant. Fixes systemd#11342.
The problem was introduced in a374220: we have a unit which has a fragment, and when we'd update it based on /proc/self/mountinfo, we'd say that e.g. What=/dev/loop8 has origin-fragment. This commit changes two things: - origin-fragment is changed to origin-mountinfo-implicit - when we stop a unit, mountinfo information is flushed and all deps based on it are dropped. The second step is important, because when we restart the unit, we want to notice that we have "fresh" mountinfo information. We could keep the old info around and solve this in a different way, but keeping stale information seems inelegant. Fixes systemd#11342.
The problem was introduced in a374220: we have a unit which has a fragment, and when we'd update it based on /proc/self/mountinfo, we'd say that e.g. What=/dev/loop8 has origin-fragment. This commit changes two things: - origin-fragment is changed to origin-mountinfo-implicit - when we stop a unit, mountinfo information is flushed and all deps based on it are dropped. The second step is important, because when we restart the unit, we want to notice that we have "fresh" mountinfo information. We could keep the old info around and solve this in a different way, but keeping stale information seems inelegant. Fixes systemd#11342.
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
umount /my/squashfs
systemctl start my-squashfs.mount
The text was updated successfully, but these errors were encountered: