]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount: clarify that umount retries do not (anymore) allow multiple timeouts
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Mon, 22 Jan 2018 17:42:25 +0000 (17:42 +0000)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 23 Jan 2018 11:09:18 +0000 (11:09 +0000)
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.

src/core/mount.c

index a9d81f2aa1c72707e4481454ebf93eec6a88695f..12f9bb2af62cc3f718578dd4b6a9bd57ecd79f0c 100644 (file)
@@ -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.");
         }