From: Andrew Morton <akpm@linux-foundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: uml-devel <user-mode-linux-devel@lists.sourceforge.net>,
linux-kernel <linux-kernel@vger.kernel.org>,
Julia Lawall <julia@diku.dk>,
Stephen Hemminger <shemminger@vyatta.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [uml-devel] {painfully BISECTED} Please revert f25c80a4b2: arch/um/drivers: remove duplicate structure field initialization
Date: Tue, 28 Sep 2010 13:47:21 -0700 [thread overview]
Message-ID: <20100928134721.f79a5955.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTim85sH_2o=xCiDuoQrHq_7ZL96Y91xQMGxUP5Fy@mail.gmail.com>
On Tue, 28 Sep 2010 13:24:40 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> Ping, no comments?
>
> On Mon, Sep 27, 2010 at 6:17 AM, Boaz Harrosh <bharrosh@panasas.com> wrote:
> >
> > [bharrosh@fs2 ~/dev/git/pub/scsi-misc] 1115$ git bisect good
> > f25c80a4b2bf93c99820f470573626557db35202 is the first bad commit
> > commit f25c80a4b2bf93c99820f470573626557db35202
>
> It looks like that commit is indeed very misleading. The commit message says:
>
> "arch/um/drivers: remove duplicate structure field initialization"
>
> but it is in fact not duplicate: there's two field initializations,
> but they are _different_. Looking at the patch, it has:
>
> .ndo_set_mac_address = uml_net_set_mac,
> - .ndo_set_mac_address = eth_mac_addr,
>
> so it removes the later one, but it is not at all clear which one the
> compiler actually used. My guess is that it used to use the later one
> (the standard eth_mac_addr function), and the patch made it suddenly
> use the uml_net_set_mac function.
>
> I didn't check what gcc used to do, but this:
>
> > The patch Reverts cleanly on top of 2.6.36-rc5 and after Revert works perfectly as
> > before.
>
> makes me suspect that nobody else checked it either.
I checked! gcc uses the second initialiser.
uml_net_set_mac() is:
static int uml_net_set_mac(struct net_device *dev, void *addr)
{
struct uml_net_private *lp = netdev_priv(dev);
struct sockaddr *hwaddr = addr;
spin_lock_irq(&lp->lock);
eth_mac_addr(dev, hwaddr->sa_data);
spin_unlock_irq(&lp->lock);
return 0;
}
And I misread that, assuming that it's just a wrapper around
eth_mac_addr(). Only it isn't, because it passes eth_mac_addr() the
MAC address's address directly (with ->sa_data). But eth_mac_addr()
expects a `struct sockaddr *'.
And for some wtf reason, eth_mac_addr() passes that `struct
sockaddr *' in a `void *', thus cunningly hiding the bug.
Yeah, please revert it.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Boaz Harrosh <bharrosh@panasas.com>, Julia Lawall <julia@diku.dk>,
"David S. Miller" <davem@davemloft.net>,
uml-devel <user-mode-linux-devel@lists.sourceforge.net>,
linux-kernel <linux-kernel@vger.kernel.org>,
Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: {painfully BISECTED} Please revert f25c80a4b2: arch/um/drivers: remove duplicate structure field initialization
Date: Tue, 28 Sep 2010 13:47:21 -0700 [thread overview]
Message-ID: <20100928134721.f79a5955.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTim85sH_2o=xCiDuoQrHq_7ZL96Y91xQMGxUP5Fy@mail.gmail.com>
On Tue, 28 Sep 2010 13:24:40 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> Ping, no comments?
>
> On Mon, Sep 27, 2010 at 6:17 AM, Boaz Harrosh <bharrosh@panasas.com> wrote:
> >
> > [bharrosh@fs2 ~/dev/git/pub/scsi-misc] 1115$ git bisect good
> > f25c80a4b2bf93c99820f470573626557db35202 is the first bad commit
> > commit f25c80a4b2bf93c99820f470573626557db35202
>
> It looks like that commit is indeed very misleading. The commit message says:
>
> "arch/um/drivers: remove duplicate structure field initialization"
>
> but it is in fact not duplicate: there's two field initializations,
> but they are _different_. Looking at the patch, it has:
>
> .ndo_set_mac_address = uml_net_set_mac,
> - .ndo_set_mac_address = eth_mac_addr,
>
> so it removes the later one, but it is not at all clear which one the
> compiler actually used. My guess is that it used to use the later one
> (the standard eth_mac_addr function), and the patch made it suddenly
> use the uml_net_set_mac function.
>
> I didn't check what gcc used to do, but this:
>
> > The patch Reverts cleanly on top of 2.6.36-rc5 and after Revert works perfectly as
> > before.
>
> makes me suspect that nobody else checked it either.
I checked! gcc uses the second initialiser.
uml_net_set_mac() is:
static int uml_net_set_mac(struct net_device *dev, void *addr)
{
struct uml_net_private *lp = netdev_priv(dev);
struct sockaddr *hwaddr = addr;
spin_lock_irq(&lp->lock);
eth_mac_addr(dev, hwaddr->sa_data);
spin_unlock_irq(&lp->lock);
return 0;
}
And I misread that, assuming that it's just a wrapper around
eth_mac_addr(). Only it isn't, because it passes eth_mac_addr() the
MAC address's address directly (with ->sa_data). But eth_mac_addr()
expects a `struct sockaddr *'.
And for some wtf reason, eth_mac_addr() passes that `struct
sockaddr *' in a `void *', thus cunningly hiding the bug.
Yeah, please revert it.
next prev parent reply other threads:[~2010-09-28 20:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-27 13:17 {painfully BISECTED} Please revert f25c80a4b2: arch/um/drivers: remove duplicate structure field initialization Boaz Harrosh
2010-09-27 14:06 ` Phil Turmel
2010-09-28 20:24 ` [uml-devel] " Linus Torvalds
2010-09-28 20:24 ` Linus Torvalds
2010-09-28 20:47 ` Andrew Morton [this message]
2010-09-28 20:47 ` Andrew Morton
2010-09-28 20:51 ` David Miller
2010-09-28 20:57 ` [uml-devel] " Linus Torvalds
2010-09-28 20:57 ` Linus Torvalds
2010-09-28 21:00 ` [uml-devel] " David Miller
2010-09-28 21:00 ` David Miller
2010-09-28 21:08 ` Linus Torvalds
2010-09-29 8:34 ` [uml-devel] [PATCH] um: Proper Fix for f25c80a4: " Boaz Harrosh
2010-09-29 8:34 ` Boaz Harrosh
2010-09-29 15:05 ` Linus Torvalds
2010-09-30 2:28 ` [uml-devel] " David Miller
2010-09-30 2:28 ` David Miller
2010-09-29 8:41 ` {painfully BISECTED} Please revert f25c80a4b2: arch/um/drivers: " Boaz Harrosh
2010-09-29 15:01 ` Linus Torvalds
2010-09-30 2:27 ` David Miller
2010-09-28 21:11 ` Al Viro
2010-09-28 21:24 ` [uml-devel] " Al Viro
2010-09-28 21:24 ` Al Viro
2010-09-28 21:42 ` David Miller
2010-09-28 21:51 ` [uml-devel] " Al Viro
2010-09-28 21:51 ` Al Viro
2010-09-29 17:19 ` [uml-devel] " Renzo Davoli
2011-01-26 16:32 ` {painfullyBISECTED} " Emil Langrock
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=20100928134721.f79a5955.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=julia@diku.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=torvalds@linux-foundation.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.