core/automount: revise the "fun fact" comments. (#6245)
authorNeilBrown <neil@brown.name>
Fri, 30 Jun 2017 16:51:33 +0000 (02:51 +1000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 30 Jun 2017 16:51:33 +0000 (12:51 -0400)
Fun fact 1 suggests that a "close()" is needed, but that close() has long since been
removed.  So the comment in now meaningless and possibly confusing.

Fun fact 2 refers to a bug that has been fixed in Linux prior to v4.12

Commit: 9fa4eb8e490a ("autofs: sanity check status reported with AUTOFS_DEV_IOCTL_FAIL")

so revise the comment so that no-one goes pointlessly looking for the bug.

src/core/automount.c

index c040efa..6a5612a 100644 (file)
@@ -474,10 +474,10 @@ static int automount_send_ready(Automount *a, Set *tokens, int status) {
         while ((token = PTR_TO_UINT(set_steal_first(tokens)))) {
                 int k;
 
-                /* Autofs fun fact II:
+                /* Autofs fun fact:
                  *
-                 * if you pass a positive status code here, the kernel will
-                 * freeze! Yay! */
+                 * if you pass a positive status code here, kernels
+                 * prior to 4.12 will freeze! Yay! */
 
                 k = autofs_send_ready(UNIT(a)->manager->dev_autofs_fd,
                                       ioctl_fd,
@@ -619,12 +619,6 @@ static void automount_enter_waiting(Automount *a) {
         if (r < 0)
                 goto fail;
 
-        /* Autofs fun fact:
-         *
-         * Unless we close the ioctl fd here, for some weird reason
-         * the direct mount will not receive events from the
-         * kernel. */
-
         r = sd_event_add_io(UNIT(a)->manager->event, &a->pipe_event_source, p[0], EPOLLIN, automount_dispatch_io, a);
         if (r < 0)
                 goto fail;