Re: [PATCH] bonding: Prevent deletion of a bond, or the last slave from a bond, with active usage.

Jiri Pirko
2016-09-06T14:59:16Z

Tue, Sep 06, 2016 at 11:34:30AM CEST, jasminder.kaur@hpe.com wrote:
>From: "Kaur, Jasminder" <jasminder.kaur@hpe.com>
>
>If a bond is in use such as with IP address configured, removing it
>can result in application disruptions. If bond is used for cluster
>communication or network file system interfaces, removing it can cause
>system down time.
>
>An additional write option “?-” is added to sysfs bond interfaces as
>below, in order to prevent accidental deletions while bond is in use.
>In the absence of any usage, the below option proceeds with bond deletion.
>“ echo "?-bondX" > /sys/class/net/bonding_masters “ .
>If usage is detected such as an IP address configured, deletion is
>prevented with appropriate message logged to syslog.
>
>In the absence of any usage, the below option proceeds with deletion of
>slaves from a bond.
>“ echo "?-enoX" > /sys/class/net/bondX/bonding/slaves “ .
>If usage is detected such as an IP address configured on bond, deletion
>is prevented if the last slave is being removed from bond.
>An appropriate message is logged to syslog.

NACK

sysfs bonding iface should die in peace, don't poke in it.

Either fix you application or fix you configuration flow. Don't do this
in kernel.