1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

core: prevent spurious retries of umount

Testing the previous commit with `systemctl stop tmp.mount` logged the
reason for failure as expected, but unexpectedly the message was repeated
32 times.

The retry is a special case for umount; it is only supposed to cover the
case where the umount command was _successful_, but there was still some
remaining mount(s) underneath.  Fix it by making sure to test the first
condition :).

Re-tested with and without a preceding `mount --bind /mnt /tmp`,
and using `findmnt` to check the end result.
This commit is contained in:
Alan Jenkins 2018-01-13 17:22:46 +00:00
parent 5804e1b6ff
commit 3cc9685649

View File

@ -1309,7 +1309,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
case MOUNT_UNMOUNTING_SIGKILL:
case MOUNT_UNMOUNTING_SIGTERM:
if (m->from_proc_self_mountinfo) {
if (f == MOUNT_SUCCESS && m->from_proc_self_mountinfo) {
/* Still a mount point? If so, let's try again. Most likely there were multiple mount points
* stacked on top of each other. Note that due to the io event priority logic we can be sure
@ -1324,7 +1324,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
mount_enter_mounted(m, f);
}
} else
mount_enter_dead(m, f);
mount_enter_dead_or_mounted(m, f);
break;