]> git.ipfire.org Git - thirdparty/systemd.git/commit
core/credential,mount: re-read /proc/self/mountinfo before invoking umount command 28957/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 24 Aug 2023 14:41:05 +0000 (23:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Sep 2023 16:05:13 +0000 (01:05 +0900)
commit1e1225614ca1106116dcad9fb37aaeb6106408ab
tree63d1c2478cec01f0ca064858ca91a50de29d706d
parent25033cca08485607aacf22ab67baf70e35eae30b
core/credential,mount: re-read /proc/self/mountinfo before invoking umount command

When a unit has credentials, stopping the service unmounts the credentials
directory. On shutdown, stopping the service and the corresponding mount
unit may be done mostly simultaneously, and if we invoke umount command soon
after umount() being called on stopping the service, the mount unit will
fail.

This makes Mount.invalidated_state flag set when umount() is called for a path,
and re-read /proc/self/mouninfo before invoking umount command if the flag is set.

Fixes #25527.
Replaces #26959.
src/core/exec-credential.c
src/core/exec-credential.h
src/core/mount.c
src/core/mount.h
src/core/unit.c