]> git.ipfire.org Git - thirdparty/systemd.git/commit
TEST-10-MOUNT: wait for userspace mount options being loaded 38327/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 24 Jul 2025 19:12:10 +0000 (04:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 24 Jul 2025 19:54:42 +0000 (04:54 +0900)
commit3f6e7ac27a4ed431c50577c7983a4043c8d853b0
tree5246d05849f06f4d3c3b8ad1f684aa88ffe34be7
parent1edc81aa134ccf68dfe568fba2dda0d668ece59b
TEST-10-MOUNT: wait for userspace mount options being loaded

When a device is mounted with userspace options such as _netdev, even when the mount event source is
triggered, only /proc/self/mountinfo may be updated, and /run/mount/utab may not be updated yet.
Hence, the mount unit may be created/updated without the userspace options. In that case, the mount
event source will be retriggered when /run/mount/utab is updated, and the mount unit will be updated
again with the userspace options. Typically, the window between the two calls is very short, but when
the mount event source is ratelimited after the first event, processing the second event may be delayed
about 1 secound. Hence, here we need to wait for a while.

By adding a debugging logs in mount_setup_unit(), the userspace mount is
not obtained in the first event, and the second event is delayed by the ratelimit.
```
[   20.023086] H TEST-10-MOUNT.sh[446]: + mount -t ext4 -o _netdev /dev/loop1p1 /tmp/deptest
[   20.026255] H kernel: EXT4-fs (loop1p1): mounted filesystem c1fa00ea-2ba8-46b2-9002-2ac997f4cda9 r/w with ordered data mode. Quota mode: none.
[   20.026537] H TEST-10-MOUNT.sh[446]: + timeout 10 bash -c 'until systemctl -q is-active tmp-deptest.mount; do sleep .1; done'
[   20.032293] H systemd[1]: tmp-deptest.mount: mount_setup_unit: proc: yes, netdev: no
[   20.035978] H systemd[1]: Unit blockdev@dev-loop1p1.target has alias blockdev@.target.
[   20.039765] H systemd[1]: tmp-deptest.mount: Changed dead -> mounted
[   20.046598] H systemd[1]: Event source 0x7c73093e05e0 (mount-monitor-dispatch) entered rate limit state.
```

Hopefully fixes #32712.
test/units/TEST-10-MOUNT.sh