netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	davem@davemloft.net, netdev@vger.kernel.org, oliver@neukum.name,
	linux-usb-devel@lists.sourceforge.net
Subject: Re: [PATCH] rtnl: Simplify ASSERT_RTNL
Date: Sun, 30 Sep 2007 17:47:30 +0200	[thread overview]
Message-ID: <46FFC512.9060101@trash.net> (raw)
In-Reply-To: <20070930002421.GA7502@gondor.apana.org.au>

Herbert Xu wrote:
> On Sat, Sep 29, 2007 at 05:32:41PM +0200, Patrick McHardy wrote:
> 
>>For unicast addresses its not strictly necessary since they may
>>only be changed under the RTNL anyway. The reason why it takes
>>the tx_lock is for consistency with multicast address handling,
>>which can't rely on the RTNL since IPv6 changes them from
>>BH context. The idea was that the ->set_rx_mode function should
>>handle both secondary unicast and multicast addresses for
>>simplicity.
> 
> 
> In any case, coming back to the original question, the RTNL
> assertion is simply wrong in this case because if we're being
> called from IPv6 then the RTNL won't even be held.
> 
> So I think we need to
> 
> 1) Move the assert into dev_set_promiscuity.
> 2) Take the TX lock in dev_set_promiscuity.


In the IPv6 case we're only changing the multicast list,
so we're never calling into __dev_set_promiscuity.

I actually even added a comment about this :)

        /* Unicast addresses changes may only happen under the rtnl,
         * therefore calling __dev_set_promiscuity here is safe.
         */

I would prefer to keep the ASSERT_RTNL in __dev_set_promiscuity
since it also covers the __dev_set_rx_mode path. How about
adding an ASSERT_RTNL_ATOMIC without the might_sleep or simply
open coding it?

  reply	other threads:[~2007-09-30 15:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-29  0:59 [PATCH] rtnl: Simplify ASSERT_RTNL Eric W. Biederman
2007-09-29  4:31 ` Herbert Xu
2007-09-29 15:32   ` Patrick McHardy
2007-09-30  0:24     ` Herbert Xu
2007-09-30 15:47       ` Patrick McHardy [this message]
2007-10-02  9:28         ` Herbert Xu
2007-10-02 15:29           ` Patrick McHardy
2007-10-03  6:06             ` Herbert Xu
2007-10-08  4:40               ` Patrick McHardy
2007-09-29 17:18   ` Eric W. Biederman
2007-09-29 17:51     ` Patrick McHardy
2007-09-30  0:28     ` Herbert Xu
2007-10-11  4:16 ` David Miller
2007-10-11  6:57   ` Eric W. Biederman
2007-10-11  7:12     ` Herbert Xu
2007-10-11  8:23       ` Eric W. Biederman
2007-10-11  8:28         ` Herbert Xu
2007-10-11 16:33           ` Eric W. Biederman
2007-10-12  0:30             ` David Miller
2007-10-12  3:15               ` Eric W. Biederman

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=46FFC512.9060101@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=oliver@neukum.name \
    /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).