Bug 684643

Summary: WARNING: at drivers/net/bonding/bond_main.c:5511 bonding_exit()
Product: Red Hat Enterprise Linux 5 Reporter: Mark Wu <dwu>
Component: kernelAssignee: Andy Gospodarek <agospoda>
Status: CLOSED DUPLICATE QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6CC: jarod, moshiro, peterm
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-13 16:18:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mark Wu 2011-03-14 05:02:56 UTC
Description of problem:

When we remove the driver using rmmod, the stack trace is given like this.
Mar 11 11:18:12 build kernel: WARNING: at drivers/net/bonding/bond_main.c:5511 bonding_exit()
Mar 11 11:18:12 build kernel: Call Trace:
Mar 11 11:18:12 build avahi-daemon[4651]: Withdrawing address record for
192.168.1.2 on bond5.
Mar 11 11:18:12 build kernel:  [<ffffffff800a8617>]
sys_delete_module+0x196/0x1c5
Mar 11 11:18:12 build kernel:  [<ffffffff8005d28d>] tracesys+0xd5/0xe0 Mar 11 11:18:12 build kernel:

This problem should be caused by only unblock operation is added in functions bonding_store_active_slave and bonding_store_primary. So, if module is removed after these operations , the work counter stays minus and the inconsistency appears.


Version-Release number of selected component (if applicable):
2.6.18-238.6.1.el5 

How reproducible:

Steps to Reproduce:
rmmod bonding
  
Actual results:
Get warning on: WARN_ON(atomic_read(&netpoll_block_tx));

Expected results:
No warning when removed the driver

Additional info:

Comment 2 Mark Wu 2011-03-14 05:07:19 UTC
It looks it need add block_netpoll_tx in functions bonding_store_active_slave and bonding_store_primary too

Comment 4 Mark Wu 2011-03-15 07:48:52 UTC
Oshiro-san,
The test kernel is available at:
https://brewweb.devel.redhat.com/taskinfo?taskID=3178244

The test patch is:

diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 6ffcdc6..37868bc 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1097,6 +1097,7 @@ static ssize_t bonding_store_primary(struct class_device *cd, const char *buf, s
        struct bonding *bond = to_bond(cd);

        rtnl_lock();
+       block_netpoll_tx();
        read_lock(&bond->lock);
        write_lock_bh(&bond->curr_slave_lock);

@@ -1258,6 +1259,7 @@ static ssize_t bonding_store_active_slave(struct class_device *cd, const char *b
        struct bonding *bond = to_bond(cd);

        rtnl_lock();
+       block_netpoll_tx();
        read_lock(&bond->lock);
        write_lock_bh(&bond->curr_slave_lock);

Comment 6 Andy Gospodarek 2011-07-13 16:18:57 UTC

*** This bug has been marked as a duplicate of bug 704426 ***

Comment 7 Andy Gospodarek 2011-07-13 16:19:51 UTC
This is fixed in 2.6.18-266.el5.