From: Cong Wang <amwang@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: netdev@vger.kernel.org
Subject: re: bonding: sync netpoll code with bridge
Date: Thu, 26 Jul 2012 15:15:05 +0800 [thread overview]
Message-ID: <1343286905.12207.7.camel@cr0> (raw)
In-Reply-To: <20120725134710.GA25625@elgon.mountain>
On Wed, 2012-07-25 at 16:47 +0300, Dan Carpenter wrote:
> Hello Amerigo Wang,
>
> The patch 8a8efa22f51b: "bonding: sync netpoll code with bridge" from
> Feb 17, 2011, leads to the following warning:
> drivers/net/bonding/bond_main.c:1849 bond_enslave()
> error: scheduling with locks held: 'read_lock:&bond->lock'
Yeah, makes sense. Just wondering why I didn't catch it when I tested
that patch. Anyway, could you try the following patch?
----------->
diff --git a/drivers/net/bonding/bond_main.c
b/drivers/net/bonding/bond_main.c
index 6fae5f3..ab773d4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1235,7 +1235,7 @@ static inline int slave_enable_netpoll(struct
slave *slave)
struct netpoll *np;
int err = 0;
- np = kzalloc(sizeof(*np), GFP_KERNEL);
+ np = kzalloc(sizeof(*np), GFP_ATOMIC);
err = -ENOMEM;
if (!np)
goto out;
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index b4c90e4..c78a966 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -734,7 +734,7 @@ int __netpoll_setup(struct netpoll *np, struct
net_device *ndev)
}
if (!ndev->npinfo) {
- npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL);
+ npinfo = kmalloc(sizeof(*npinfo), GFP_ATOMIC);
if (!npinfo) {
err = -ENOMEM;
goto out;
next prev parent reply other threads:[~2012-07-26 7:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-25 13:47 bonding: sync netpoll code with bridge Dan Carpenter
2012-07-26 7:15 ` Cong Wang [this message]
2012-07-26 8:17 ` Dan Carpenter
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=1343286905.12207.7.camel@cr0 \
--to=amwang@redhat.com \
--cc=dan.carpenter@oracle.com \
--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).