public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare•com>
To: David Miller <davem@davemloft•net>
Cc: Jeff Garzik <jgarzik@pobox•com>, netdev@vger•kernel.org
Subject: [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close().
Date: Tue, 6 May 2008 19:34:06 +0100	[thread overview]
Message-ID: <20080506183405.GG2217@solarflare.com> (raw)
In-Reply-To: <20080506182654.GF2217@solarflare.com>

dev_open() and dev_close() must be called holding the RTNL, since they
call device functions and netdevice notifiers that are promised the RTNL.

Signed-off-by: Ben Hutchings <bhutchings@solarflare•com>
---
 net/core/dev.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index d334446..e76f4fd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -994,6 +994,8 @@ int dev_open(struct net_device *dev)
 {
 	int ret = 0;
 
+	ASSERT_RTNL();
+
 	/*
 	 *	Is it already up?
 	 */
@@ -1060,6 +1062,8 @@ int dev_open(struct net_device *dev)
  */
 int dev_close(struct net_device *dev)
 {
+	ASSERT_RTNL();
+
 	might_sleep();
 
 	if (!(dev->flags & IFF_UP))

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.


  reply	other threads:[~2008-05-06 18:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 18:26 [PATCH 0/4] dev_open() and dev_close() require RTNL Ben Hutchings
2008-05-06 18:34 ` Ben Hutchings [this message]
2008-05-08  9:53   ` [PATCH 1/4] Added ASSERT_RTNL() to dev_open() and dev_close() David Miller
2008-05-06 18:36 ` [PATCH 2/4] qla3xxx: Hold RTNL while calling dev_close() Ben Hutchings
2008-05-08  9:53   ` David Miller
2008-06-27  5:32   ` Jeff Garzik
2008-05-06 18:39 ` [PATCH 3/4] sky2: " Ben Hutchings
2008-05-06 20:26   ` Stephen Hemminger
2008-05-06 23:17   ` Stephen Hemminger
2008-05-06 23:59     ` Ben Hutchings
2008-05-31 15:52       ` [PATCH] sky2: Hold RTNL while calling dev_close() [2nd try] Ben Hutchings
2008-06-10 22:16         ` Jeff Garzik
2008-06-10 22:25           ` Stephen Hemminger
2008-06-10 22:40         ` Jeff Garzik
2008-05-06 18:41 ` [PATCH 4/4] Hold RTNL while calling dev_close() Ben Hutchings
2008-05-08  9:54   ` David Miller
2008-06-27  5:32   ` Jeff Garzik

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=20080506183405.GG2217@solarflare.com \
    --to=bhutchings@solarflare$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=jgarzik@pobox$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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