Bug 220525 - not all enslaved devices are removed in 'ifdown bond0'
not all enslaved devices are removed in 'ifdown bond0'
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
: Regression
Depends On:
  Show dependency treegraph
Reported: 2006-12-21 17:07 EST by Andy Gospodarek
Modified: 2014-06-29 18:58 EDT (History)
2 users (show)

See Also:
Fixed In Version: RC
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-02-07 20:58:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
possible patch (1008 bytes, patch)
2006-12-21 17:08 EST, Andy Gospodarek
no flags Details | Diff
ifdown failure debug (17.76 KB, text/plain)
2006-12-21 17:09 EST, Andy Gospodarek
no flags Details
ifdown debug with attached patch (13.50 KB, patch)
2006-12-21 17:10 EST, Andy Gospodarek
no flags Details | Diff
shorter diff (812 bytes, patch)
2007-01-04 16:41 EST, Bill Nottingham
no flags Details | Diff
better patch (827 bytes, patch)
2007-01-04 16:47 EST, Bill Nottingham
no flags Details | Diff
patch. tested! (827 bytes, patch)
2007-01-04 16:49 EST, Bill Nottingham
no flags Details | Diff

  None (edit)
Description Andy Gospodarek 2006-12-21 17:07:32 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv: Gecko/20061025 Firefox/

Description of problem:
After seening Herbert Xu's patch on rhkl to change the fact that all slave devices are not removed when a bonded inteface is taken down:

* Sun Dec 17 2006 Don Zickus <dzickus@redhat.com> [2.6.18-1.2910.el5]
- bonding: Don't release slaves when master is admin down (Herbert Xu ) [215887]

I tested bonding with the latest initscripts to see if there were any lingering issues.  Turns out there are.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Set BONDING_OPTS="mode=0 miimon=100" in ifcfg-bond0
2.  Add at least 2 interfaces to the bond.
3.  After interfaces are up, do an ifdown bond0

Actual Results:
You will notice that only the first slave will be removed from the bond.  

Expected Results:
All slave devices are removed from the bond.

Additional info:
This happens because checking ifdown-eth looks at the slaves mac address and assumes that the macs are correct and the ifcfg files are wrong and does an ifdown on the first active slave over and over.
Comment 1 Andy Gospodarek 2006-12-21 17:08:55 EST
Created attachment 144225 [details]
possible patch

quick patch that worked for me
Comment 2 Andy Gospodarek 2006-12-21 17:09:47 EST
Created attachment 144226 [details]
ifdown failure debug
Comment 3 Andy Gospodarek 2006-12-21 17:10:43 EST
Created attachment 144227 [details]
ifdown debug with attached patch
Comment 4 RHEL Product and Program Management 2006-12-21 17:20:42 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
Comment 5 Bill Nottingham 2007-01-04 16:41:15 EST
Created attachment 144847 [details]
shorter diff

Here's a shorter diff that works for me - does it work for you?

Note that without this, just doing (for example) 'ifdown eth1' will fail too.
Comment 6 Andy Gospodarek 2007-01-04 16:45:17 EST
I'll test it tomorrow morning to be sure, but I like it.
Comment 7 Bill Nottingham 2007-01-04 16:47:20 EST
Created attachment 144848 [details]
better patch

This makes it abundantly clear what we're doing here, at the expense of
breaking indentation.
Comment 8 Bill Nottingham 2007-01-04 16:49:46 EST
Created attachment 144849 [details]
patch. tested!

Comment 9 Andy Gospodarek 2007-01-04 17:34:38 EST
Does that work when the MAC gets changed since the bond gives each slave it's
MAC?  That was the original reason why the old check wasn't working on my system.
Comment 10 Bill Nottingham 2007-01-04 20:24:19 EST
Basically, what it does is skip the MAC check entirely when bringing down any
interface that's a bonding slave (has SLAVE set to 'yes' and has a MASTER set.)
The only situation where something odd could happen is if you have slaves that
aren't actually defined in the configuration as such - of course, that case
can't really work right anyway (and is somewhat nonsensical.)

Raising as blocker, since it's a regression.

Short summary: detaching bond slaves whether via 'ifdown <bonding device>' or
'ifdown <slave device>' doesn't work right.

Patch has been tested and resolves it for the reproducer provided.

Risk to non-bonding configurations: none.
Risk to bonding configurations: should be none - at worst, a case that's already
broken may still be broken.

Built in 8.45.13.EL-1.
Comment 11 Jay Turner 2007-01-08 09:34:57 EST
QE ack for RHEL5.
Comment 12 RHEL Product and Program Management 2007-02-07 20:58:52 EST
A package has been built which should help the problem described in 
this bug report. This report is therefore being closed with a resolution 
of CURRENTRELEASE. You may reopen this bug report if the solution does 
not work for you.

Note You need to log in before you can comment on or make changes to this bug.