From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F40FC10F0E for ; Fri, 12 Apr 2019 14:12:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2BEA820850 for ; Fri, 12 Apr 2019 14:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727110AbfDLOMa (ORCPT ); Fri, 12 Apr 2019 10:12:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbfDLOM3 (ORCPT ); Fri, 12 Apr 2019 10:12:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A3EB53005159; Fri, 12 Apr 2019 14:12:24 +0000 (UTC) Received: from bistromath.localdomain (unknown [10.40.205.249]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E50645D707; Fri, 12 Apr 2019 14:12:19 +0000 (UTC) Date: Fri, 12 Apr 2019 16:12:18 +0200 From: Sabrina Dubroca To: Jiri Pirko Cc: netdev@vger.kernel.org, Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , Jarod Wilson Subject: Re: [PATCH net] bonding: fix event handling for stacked bonds Message-ID: <20190412141218.GA29605@bistromath.localdomain> References: <9e7fda25884e8e68b1932a48de58189a08ef906f.1555073754.git.sd@queasysnail.net> <20190412135755.GA2268@nanopsycho.orion> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190412135755.GA2268@nanopsycho.orion> User-Agent: Mutt/1.11.4 (2019-03-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 12 Apr 2019 14:12:29 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 2019-04-12, 15:57:55 +0200, Jiri Pirko wrote: > Fri, Apr 12, 2019 at 03:04:10PM CEST, sd@queasysnail.net wrote: > >When a bond is enslaved to another bond, bond_netdev_event() only > >handles the event as if the bond is a master, and skips treating the > >bond as a slave. > > > >This leads to a refcount leak on the slave, since we don't remove the > >adjacency to its master and the master holds a reference on the slave. > > > >Reproducer: > > ip link add bondL type bond > > ip link add bondU type bond > > ip link set bondL master bondU > > ip link del bondL > > Out of curiosity, what is a usecase of stacked bonds? I don't see any. I don't have one, but nothing is preventing that setup. It's just something I accidentally ran into while testing other things. If you want to prevent bond-bond, you also need to prevent things like bond-macvlan-bond for example. The set of rules of what types of stacking make sense seems a bit hairy. -- Sabrina