From: Veaceslav Falico <vfalico@redhat.com>
To: netdev@vger.kernel.org
Cc: amwang@redhat.com, davem@davemloft.net
Subject: [PATCH] netconsole: release the spinlock before __netpoll_cleanup()
Date: Wed, 6 Mar 2013 15:46:43 +0100 [thread overview]
Message-ID: <1362581203-8994-1-git-send-email-vfalico@redhat.com> (raw)
Commit 3335f0ca130c201f8680e97f63612053fbc16e22 removed spinlock unlocking
before __netpoll_cleanup() in netconsole_netdev_event(), however we still
might sleep in __netpoll_cleanup() - via synchronize_srcu(). Revert it and
add a comment.
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
drivers/net/netconsole.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 37add21..dd62b4c 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -680,7 +680,17 @@ static int netconsole_netdev_event(struct notifier_block *this,
* rtnl_lock already held
*/
if (nt->np.dev) {
+ /*
+ * we still might sleep in
+ * __netpoll_cleanup(), so release
+ * the lock
+ */
+ spin_unlock_irqrestore(
+ &target_list_lock,
+ flags);
__netpoll_cleanup(&nt->np);
+ spin_lock_irqsave(&target_list_lock,
+ flags);
dev_put(nt->np.dev);
nt->np.dev = NULL;
}
--
1.7.1
next reply other threads:[~2013-03-06 14:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 14:46 Veaceslav Falico [this message]
2013-03-06 14:51 ` [PATCH] netconsole: release the spinlock before __netpoll_cleanup() Cong Wang
2013-03-07 0:08 ` Neil Horman
2013-03-07 10:03 ` Veaceslav Falico
2013-03-07 14:43 ` Neil Horman
2013-03-07 21:14 ` David Miller
2013-03-10 15:25 ` Veaceslav Falico
2013-03-11 10:08 ` Veaceslav Falico
2013-03-11 11:30 ` Neil Horman
2013-03-11 11:39 ` Veaceslav Falico
2013-03-11 17:58 ` Neil Horman
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=1362581203-8994-1-git-send-email-vfalico@redhat.com \
--to=vfalico@redhat.com \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).