From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751292AbcIIA5J (ORCPT ); Thu, 8 Sep 2016 20:57:09 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:34928 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750974AbcIIA5G (ORCPT ); Thu, 8 Sep 2016 20:57:06 -0400 Date: Thu, 8 Sep 2016 17:57:15 -0700 From: Stephen Hemminger To: Jay Vosburgh Cc: "Kaur\, Jasminder" , vfalico@gmail.com, gospo@cumulusnetworks.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, vasundhara.gurunath@hpe.com, paulose.kuriakose.arackal@hpe.com Subject: Re: [PATCH] bonding: Prevent deletion of a bond, or the last slave from a bond, with active usage. Message-ID: <20160908175715.2c55e66c@xeon-e3> In-Reply-To: <4691.1473174539@famine> References: <1473154470-15087-1-git-send-email-jasminder.kaur@hpe.com> <4691.1473174539@famine> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u890vElE029005 On Tue, 06 Sep 2016 08:08:59 -0700 Jay Vosburgh wrote: > Kaur, Jasminder wrote: > > >From: "Kaur, Jasminder" > > > >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. > > The issue of interfaces being arbitrarily changed or deleted is > not specific to bonding, and could affect any networking device > (physical or virtual). Thus, if a facility such as this is to be > provided, it should be generic, not specific to bonding. > > Separately, I'm not sure I see the value of such an option. > Other than administrator error, I'm not sure when bonds (or other > interfaces) would be randomly deleted. Are you seeing that happening? > > Also, this patch does not prevent other errors or malicious > change, e.g., "ip link set bondX down" or "ip addr del 1.2.3.4/24" would > still cause the service disruption you're trying to avoid. > > And, lastly, what Jiri said: use netlink for new bonding > functionality, not sysfs. > > -J > > >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. > > > >Signed-off-by: Jasminder Kaur I agree with Jay. Unless the kernel would crash there is no reason to prevent a user with sufficient permissions from deleting a device.