From: Patrick McHardy <kaber@trash.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org, oliver@neukum.name,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-usb-devel@lists.sourceforge.net, davem@davemloft.net
Subject: Re: [PATCH] rtnl: Simplify ASSERT_RTNL
Date: Tue, 2 Oct 2007 17:29:11 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.0.9999.0710021658100.12705@x2> (raw)
In-Reply-To: <20071002092819.GA29824@gondor.apana.org.au>
On Tue, 2 Oct 2007, Herbert Xu wrote:
> On Sun, Sep 30, 2007 at 05:47:30PM +0200, Patrick McHardy wrote:
>>
> I'm a bit uncomfortable with having a function (change_flags)
> that's sometimes in a sleepable context and sometimes running
> with BH disabled.
>
> So how about splitting up the unicast/multicast entry points
> as follows?
>
> [NET]: Restore multicast-only __dev_mc_upload
>
> As it is dev_set_rx_mode needs to cope with being called with
> or without the RTNL. This is rather confusing when it comes
> to understanding what locks are being held at a particular
> point.
>
> Since the only path that calls it without the RTNL is in the
> multicast code, we could avoid the confusion by splitting that
> out.
>
> This patch restores the old __dev_mc_upload as a multicast-only
> variant of dev_set_rx_mode. It also gets rid of the now-unused
> __dev_set_rx_mod and makes dev_set_rx_mode static since it's
> only used in net/core/dev.c.
>
> As a side-effect this fixes the warning triggered by the
> RTNL_ASSERT in __dev_set_promiscuity.
I think this doesn't completely fix it, when dev_unicast_add is
interrupted by dev_mc_add before the unicast changes are performed,
they will get committed in the dev_mc_add context, so we might still
call change_flags with BH disabled. Taking the TX lock around the
dev->uc_count and dev->uc_promisc checks and changes in __dev_set_rx_mode
should fix this.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
next prev parent reply other threads:[~2007-10-02 15:29 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
2007-10-02 9:28 ` Herbert Xu
2007-10-02 15:29 ` Patrick McHardy [this message]
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=alpine.DEB.0.9999.0710021658100.12705@x2 \
--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