diff mbox

[net] bonding: remove unwanted bond lock for enslave processing

Message ID 52F88EF7.606@huawei.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Ding Tianhong Feb. 10, 2014, 8:33 a.m. UTC
The bond enslave processing don't hold bond->lock anymore,
so release an unlocked rw lock will cause warning message,
remove the unwanted read_unlock(&bond->lock).

Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bond_main.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Veaceslav Falico Feb. 10, 2014, 8:49 a.m. UTC | #1
On Mon, Feb 10, 2014 at 04:33:59PM +0800, Ding Tianhong wrote:
>The bond enslave processing don't hold bond->lock anymore,
>so release an unlocked rw lock will cause warning message,
>remove the unwanted read_unlock(&bond->lock).
>
>Cc: Jay Vosburgh <fubar@us.ibm.com>
>Cc: Veaceslav Falico <vfalico@redhat.com>
>Cc: Andy Gospodarek <andy@greyhouse.net>
>Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>

Good catch.

Acked-by: Veaceslav Falico <vfalico@redhat.com>

>---
> drivers/net/bonding/bond_main.c | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index a7db819..ccfb998 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1505,7 +1505,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
> 	slave_dev->npinfo = bond->dev->npinfo;
> 	if (slave_dev->npinfo) {
> 		if (slave_enable_netpoll(new_slave)) {
>-			read_unlock(&bond->lock);
> 			pr_info("Error, %s: master_dev is using netpoll, "
> 				 "but new slave device does not support netpoll.\n",
> 				 bond_dev->name);
>-- 
>1.8.0
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 11, 2014, 12:55 a.m. UTC | #2
From: Ding Tianhong <dingtianhong@huawei.com>
Date: Mon, 10 Feb 2014 16:33:59 +0800

> The bond enslave processing don't hold bond->lock anymore,
> so release an unlocked rw lock will cause warning message,
> remove the unwanted read_unlock(&bond->lock).
> 
> Cc: Jay Vosburgh <fubar@us.ibm.com>
> Cc: Veaceslav Falico <vfalico@redhat.com>
> Cc: Andy Gospodarek <andy@greyhouse.net>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a7db819..ccfb998 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1505,7 +1505,6 @@  int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 	slave_dev->npinfo = bond->dev->npinfo;
 	if (slave_dev->npinfo) {
 		if (slave_enable_netpoll(new_slave)) {
-			read_unlock(&bond->lock);
 			pr_info("Error, %s: master_dev is using netpoll, "
 				 "but new slave device does not support netpoll.\n",
 				 bond_dev->name);