From: Alan Jenkins Date: Sat, 13 Jan 2018 17:22:46 +0000 (+0000) Subject: core: prevent spurious retries of umount X-Git-Tag: v237~108^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7871%2Fhead;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/mount.c b/src/core/mount.c index 9b0b29bff9e..d424e5a3a85 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -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;