From patchwork Fri Feb 20 22:20:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 442143 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 39B07140146 for ; Sat, 21 Feb 2015 09:20:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755172AbbBTWUr (ORCPT ); Fri, 20 Feb 2015 17:20:47 -0500 Received: from mail-we0-f181.google.com ([74.125.82.181]:40355 "EHLO mail-we0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754617AbbBTWUq (ORCPT ); Fri, 20 Feb 2015 17:20:46 -0500 Received: by wesx3 with SMTP id x3so8069743wes.7 for ; Fri, 20 Feb 2015 14:20:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=wIvQq6QvkVsoGFa+OkRZakYZfZZgWs+mdKDB0GT8HkA=; b=D9Bl87LBVPgFxtkjDlKVbF0osNXeUq8SAIQPG8+kDfliXmc3/CbwdWyd07Xlb2Jq3/ WTPmz8TmHZhMoVWcd7gWbt3jjJQPiLoNdAr5d1SajNhBzmS65KhG6zl2JdMvNZG341Y4 M3wuWQr3jF0T1jVk1EAk3GLn32u6HYr6803zkViSouL7znjS3fV2Je2vjRoMIF1xM5dq wAbu8nJ4W2K+WZup13ke4XN6rTbCjBMC4IVQFGi2NmChJepuUOxOMAmIvrI87GZJrLRF QKueV/1MYqdziaukPwtRUnYoFawleow5B7oGWQ337GMKGqQbzoZAVKkTmYsI/+368Sdd xd8g== X-Received: by 10.180.10.71 with SMTP id g7mr1778931wib.26.1424470845419; Fri, 20 Feb 2015 14:20:45 -0800 (PST) Received: from p183.telecom.by (nat4-minsk-pool-46-53-177-222.telecom.by. [46.53.177.222]) by mx.google.com with ESMTPSA id f1sm4276241wij.2.2015.02.20.14.20.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Feb 2015 14:20:44 -0800 (PST) Date: Sat, 21 Feb 2015 01:20:42 +0300 From: Alexey Dobriyan To: davem@davemloft.net Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, netdev@vger.kernel.org Subject: [PATCH] bonding: ban stacked bonding support Message-ID: <20150220222042.GA15595@p183.telecom.by> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Does Linux support it at all? In short: if you add bonding master as a slave, and then release it, it will no longer be a IFF_BONDING creating problems like described at https://bugzilla.kernel.org/show_bug.cgi?id=89541 echo +bond1 >/sys/class/net/bonding_masters echo 1 >/sys/class/net/bond1/bonding/mode echo +bond2 >/sys/class/net/bonding_masters echo +bond2 >/sys/class/net/bond1/bonding/slaves echo -bond2 >/sys/class/net/bond1/bonding/slaves echo -bond2 >/sys/class/net/bonding_masters cat /proc/net/bonding/bond2 # should not exist [oops] Signed-off-by: Alexey Dobriyan Signed-off-by: Jay Vosburgh Signed-off-by: Andy Gospodarek --- drivers/net/bonding/bond_main.c | 5 +++++ 1 file changed, 5 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1248,6 +1248,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) slave_dev->name); } + if (slave_dev->flags & IFF_MASTER) { + netdev_dbg(bond_dev, "stacked bonding not supported\n"); + return -EBUSY; + } + /* already enslaved */ if (slave_dev->flags & IFF_SLAVE) { netdev_dbg(bond_dev, "Error: Device was already enslaved\n");