Bug 1136016 - Creation of bonds with similar names fails
Summary: Creation of bonds with similar names fails
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukáš Nykrýn
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1136337 1136339
TreeView+ depends on / blocked
 
Reported: 2014-09-01 13:02 UTC by john.haxby@oracle.com
Modified: 2015-06-30 01:20 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
: 1136337 1136339 (view as bug list)
Environment:
Last Closed: 2015-06-30 01:20:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch against git master (933 bytes, patch)
2014-09-01 14:47 UTC, john.haxby@oracle.com
no flags Details | Diff

Description john.haxby@oracle.com 2014-09-01 13:02:14 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 john.haxby@oracle.com 2014-09-01 13:25:32 UTC
[I'm not sure how that initial empty description got created.  Sorry.]

Description of problem:

If you create a bond whose name is a substring of an existing bond, then the new bond will not be created.  This is because install_bonding_driver() in /etc/sysconfig/network-scripts/network-functions contains the test "grep -sq "$1" /sys/class/net/bonding_masters".

Version-Release number of selected component (if applicable):
    initscripts-9.51-2.fc20.x86_64


How reproducible: Always.  Easily reproduced with a slightly contrived example.


Steps to Reproduce:
1.  Create /etc/sysconfig/network-/scripts/ifcfg-bond1 and ifcfg-bond11 like this:

    DEVICE=bond1
    TYPE=Bond
    BONDING_MASTER=yes
    BOOTPROTO=none
    ONBOOT=yes
    BONDING_OPTS="miimon=100 mode=802.3ad"

ifcfg-bond11 is the same except that the DEVCIE is, of course, bond11.

2. ifup bond11
3. ifup bond1

Actual results:

bond11 comes up, bond1 reports errors:

./network-functions: line 439: /sys/class/net/bond1/bonding/slaves: No such file or directory
./network-functions: line 439: [: too many arguments
./network-functions: line 439: /sys/class/net/bond1/bonding/slaves: No such file or directory
./network-functions: line 439: [: too many arguments
ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device bond1 does not seem to be present, delaying initialisation.


Expected results: both bonds come up


Additional info:

As I say, this is a contrived example.   Interfaces are normally brought up in lexical order so bond1 would come up first and bond11 afterwards.   The fix is easy and not even worth a patch file:   change "grep -sq" to "fgrep -sqx"

Comment 2 john.haxby@oracle.com 2014-09-01 14:26:29 UTC
I noticed that commit e956710ffda24a569460688f99a1d410328bbc61 is a partial fix for this problem.  If uses "grep -sqw" but there's no reason why I shouldn't call my bonds bond1 and bond1.89fe (that's closer to the original problem I had).

Changing to fgrep -x both avoids that problem and the possible problem with regexp matches.

Comment 3 john.haxby@oracle.com 2014-09-01 14:47:34 UTC
Created attachment 933462 [details]
Patch against git master

This is a patch against the git master rather than the current F20 version.   It doesn't need to change much to become a patch against F20.

Comment 4 Lukáš Nykrýn 2014-09-16 14:07:11 UTC
https://git.fedorahosted.org/cgit/initscripts.git/commit/?id=2cf0171f48703e29703b12a3ec214365a1b725fe

will be in next release of initscripts

Comment 5 John Haxby 2014-09-18 13:51:12 UTC
Unfortunately you missed out a vital part of my proposed patch.  You have committed a change that uses "grep -sqx" rather than "fgrep -sqx".  This means that trying to add "bond.1" when "bond11" exists will break because "bond.1" matches "bond11".

Sorry I didn't spot this earlier.

Comment 6 Fedora End Of Life 2015-05-29 12:46:49 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2015-06-30 01:20:19 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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