From: Alan Jenkins Date: Mon, 22 Jan 2018 17:42:25 +0000 (+0000) Subject: mount: clarify that umount retries do not (anymore) allow multiple timeouts X-Git-Tag: v237~47^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=570183612189f5dcc4f7a613cd13da43d652b4cf;p=thirdparty%2Fsystemd.git mount: clarify that umount retries do not (anymore) allow multiple timeouts It _looks_ as if, back when we used to retry unsuccessful calls to umount, this would have inflated the effective timeout. Multiplying it by RETRY_UMOUNT_MAX. Which is set to 32. I'm surprised if it's true: I would have expected it to be noticed during the work on NFS timeouts. But I can't see what would have stopped it. Clarify that I do not expect this to happen anymore. I think each individual umount call is allowed up to the full timeout, but if umount ever exited with a signal status, we would stop retrying. To be extra clear, make sure that we do not retry in the event that umount perversely returned EXIT_SUCCESS after receiving SIGTERM. --- diff --git a/src/core/mount.c b/src/core/mount.c index a9d81f2aa1c..12f9bb2af62 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1308,13 +1308,12 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; case MOUNT_UNMOUNTING: - case MOUNT_UNMOUNTING_SIGKILL: - case MOUNT_UNMOUNTING_SIGTERM: 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. */ + * stacked on top of each other. We might exceed the timeout specified by the user overall, + * but we will stop as soon as any one umount times out. */ if (m->n_retry_umount < RETRY_UMOUNT_MAX) { log_unit_debug(u, "Mount still present, trying again."); @@ -1329,6 +1328,11 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; + case MOUNT_UNMOUNTING_SIGKILL: + case MOUNT_UNMOUNTING_SIGTERM: + mount_enter_dead_or_mounted(m, f); + break; + default: assert_not_reached("Uh, control process died at wrong time."); }