mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: Thomas Meyer <thomas@m3y3r.de>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dhowells@redhat.com
Subject: Re: [PATCH] Force same size of struct autofs_v5_packet on x86 and x86_64
Date: Fri, 16 Sep 2011 18:38:16 +0800	[thread overview]
Message-ID: <1316169496.8502.6.camel@perseus.themaw.net> (raw)
In-Reply-To: <20110916101903.GI2203@ZenIV.linux.org.uk>

On Fri, 2011-09-16 at 11:19 +0100, Al Viro wrote:
> On Fri, Sep 16, 2011 at 12:06:38PM +0200, Thomas Meyer wrote:
> > autofs_v5_packet is 300 bytes on x86 and 304 bytes on x86_64.
> > This difference is wrong and leads to a hang in systemd when running
> > a x86 userspace on an x86_64 kernel.
> 
> NAK.
> 
> You are talking about the userland ABI.  With existing users.  Changing
> it might help systemd (what the hell is it doing with autofs, anyway?),
> but breaking existing binaries (you know, ones that *do* have some business
> dealing with autofs) is not acceptable.

That's right.

Certainly my mistake (made a long time ago) and when I realized it I
decided I would need to handle it in user space for the same reasons Al
has mentioned.

I think this should be enough (but any further recommendations are
welcome, apart from the fact we might get new archs):

static size_t get_kpkt_len(void)
{
        size_t pkt_len = sizeof(struct autofs_v5_packet);
        struct utsname un;

        uname(&un);

        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;

        }

        return pkt_len;
}


  reply	other threads:[~2011-09-16 10:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16 10:06 Thomas Meyer
2011-09-16 10:19 ` Al Viro
2011-09-16 10:38   ` Ian Kent [this message]
2011-09-18  8:01     ` Thomas Meyer
2011-09-19  3:52       ` Ian Kent
2011-09-19  6:10         ` Al Viro
2011-09-19  9:30           ` Thomas Meyer
2011-09-19 15:27             ` Al Viro
2011-09-20  3:07             ` Ian Kent

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=1316169496.8502.6.camel@perseus.themaw.net \
    --to=raven@themaw.net \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@m3y3r.de \
    --cc=viro@ZenIV.linux.org.uk \
    /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

all inboxes | Powered by JetHome®