linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: mjt@tls.msk.ru, linux-kernel@vger.kernel.org,
	autofs@vger.kernel.org, raven@themaw.net, thomas@m3y3r.de,
	stable@kernel.org
Subject: Re: [PATCH v2] Introduce a version6 of autofs interface, to fix design error.
Date: Fri, 27 Apr 2012 11:55:12 -0700	[thread overview]
Message-ID: <CA+55aFyLk-uPMVaic19YOWdvdj2pv4R+E3s7UQ6voAy6UkO_Sg@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFwvFaxBT8Mdp5s4-6Gxy7nM4WVzbWna4RF_OUK3hnx+jQ@mail.gmail.com>

On Fri, Apr 27, 2012 at 11:42 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> There's no question that systemd is broken.

Actually, I'll take that back.

Yes, systemd has breakage. But it's actually automount that is the
truly broken piece of sh*t.

I think that 'automount' is even more broken. The fact that the
automount maintainers knew about this, and added TOTALLY BROKEN code
to their automount source tree, over five years ago, because the
authors clearly did not understand what the f*ck they were doing,
that's the real problem.

Look at the automount source code:

        if (pkt_len % 8) {
                if (strcmp(un.machine, "alpha") == 0 ||
                    strcmp(un.machine, "ia64") == 0 ||
                    strcmp(un.machine, "x86_64") == 0 ||
                    strcmp(un.machine, "ppc64") == 0)
                        pkt_len += 4;

        }

and realize that the above is *wrong*. It's complete and utter shit.
It's actively insane. The above source code makes zero sense.

The whole issue does not *exist* on alpha, ia64, or ppc64 (or sparc64,
which isn't even listed), because those architectures don't have the
issue that their 32-bit version has different default alignment for a
64-bit entity.

So autofs-tools was and remains actively *wrong*.

In contrast, the systemd source code actually makes sense. We should
point to it as the *correct* user, and autofs as the legacy bug.

Which is why I actually think that it makes more sense to special-case
the real bug - in automount. It's why I think that it's ok to do the
strcmp(), and why the strcmp should check for "automount", not
"systemd".

I just think it needs a big honking comment that explains it. Something like

   int autofs_compat_interface()
   {
      if (!is_compat_task())
            return 0;
      /* "autofs" has crazy shit going on working around an old compat
bug, and actually
          expects the non-compat size with a 64-bit kernel */
      if (!strcmp(current->comm, "automount"))
            return 0;
      return 1;
   }

because it really is an autofs bug.

If the autofs people had understood what they were doing, none of this
would ever have happened.

Still, checking for strings is ugly. I do think it would be even
better if we could trigger on another difference, but whatever..

                    Linus

  reply	other threads:[~2012-04-27 18:55 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 13:34 [PATCH v2] Introduce a version6 of autofs interface, to fix design error Michael Tokarev
2012-04-26 13:44 ` Michael Tokarev
2012-04-27  0:37 ` Linus Torvalds
2012-04-27  9:45   ` Michael Tokarev
2012-04-27 15:47     ` Mark Lord
2012-04-27 20:37       ` H. Peter Anvin
2012-04-28 22:20         ` Mark Lord
2012-04-27 16:22     ` David Miller
2012-04-27 17:10       ` Michael Tokarev
2012-04-27 17:28         ` David Miller
2012-04-27 18:19     ` Linus Torvalds
2012-04-27 18:34       ` David Miller
2012-04-27 18:42         ` Linus Torvalds
2012-04-27 18:55           ` Linus Torvalds [this message]
2012-04-27 19:14             ` David Miller
2012-04-27 19:16               ` David Miller
2012-04-27 19:19                 ` Linus Torvalds
2012-04-27 19:24                   ` David Miller
2012-04-27 19:56                     ` Linus Torvalds
2012-04-27 20:13                       ` Stef Bon
2012-04-27 20:29                       ` David Miller
2012-04-27 22:40                         ` Linus Torvalds
2012-04-27 20:43                       ` H. Peter Anvin
2012-04-27 22:42                         ` Linus Torvalds
2012-04-27 22:56                           ` H. Peter Anvin
2012-04-27 23:07                             ` Linus Torvalds
2012-04-28  0:03                               ` H. Peter Anvin
2012-04-28  0:17                                 ` Linus Torvalds
2012-04-27 22:42                       ` Alan Cox
2012-04-27 22:49                         ` Linus Torvalds
2012-04-27 23:27                         ` Linus Torvalds
2012-04-28 16:10                           ` Linus Torvalds
2012-04-29  6:37                             ` Michael Tokarev
2012-04-29  7:19                               ` Linus Torvalds
2012-04-29  7:45                                 ` Michael Tokarev
2012-04-29 18:29                                   ` Linus Torvalds
2012-04-29 19:09                                     ` Linus Torvalds
2012-04-29 19:53                                       ` Michael Tokarev
2012-04-29 20:53                                         ` Linus Torvalds
2012-04-30  8:41                                         ` Thomas Meyer
2012-04-28  1:56               ` Ian Kent
2012-04-27 19:08           ` David Miller
2012-04-27 20:45             ` H. Peter Anvin
2012-04-27 20:42       ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+55aFyLk-uPMVaic19YOWdvdj2pv4R+E3s7UQ6voAy6UkO_Sg@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=autofs@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    --cc=raven@themaw.net \
    --cc=stable@kernel.org \
    --cc=thomas@m3y3r.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).