From patchwork Mon Apr 23 12:01:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tiainen, Antti" X-Patchwork-Id: 10356891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 606D660388 for ; Mon, 23 Apr 2018 12:02:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48E3528A81 for ; Mon, 23 Apr 2018 12:02:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C8D828A89; Mon, 23 Apr 2018 12:02:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from bastion.fedoraproject.org (bastion01.fedoraproject.org [209.132.181.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B3DA928A81 for ; Mon, 23 Apr 2018 12:01:57 +0000 (UTC) Received: from mailman01.phx2.fedoraproject.org (mailman01.phx2.fedoraproject.org [10.5.126.36]) by bastion01.phx2.fedoraproject.org (Postfix) with ESMTP id B2ADF601E6FB; Mon, 23 Apr 2018 12:01:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.phx2.fedoraproject.org B2ADF601E6FB Received: from mailman01.phx2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id AC8362564F983; Mon, 23 Apr 2018 12:01:56 +0000 (UTC) Received: by mailman01.phx2.fedoraproject.org (Postfix, from userid 991) id C54AB2564F983; Mon, 23 Apr 2018 12:01:47 +0000 (UTC) Received: from smtp-mm-tummy01.fedoraproject.org (smtp-mm-tummy01.vpn.fedoraproject.org [192.168.1.82]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id 211752564F31A for ; Mon, 23 Apr 2018 12:01:47 +0000 (UTC) Received: from esg-sm.forcepoint.com (esg-sm3.forcepoint.com [204.15.67.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.forcepoint.com", Issuer "Go Daddy Secure Certificate Authority - G2" (verified OK)) by smtp-mm-tummy01.fedoraproject.org (Postfix) with ESMTPS id C956B6087EC8 for ; Mon, 23 Apr 2018 12:01:46 +0000 (UTC) Received: from SSDEXCH2B.websense.com (unknown [10.64.80.131]) by Forcepoint Email with ESMTPS id 8ADCDE7EBD8D4127D123; Mon, 23 Apr 2018 05:01:45 -0700 (PDT) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (216.32.181.22) by webmail.websense.com (10.64.80.131) with Microsoft SMTP Server (TLS) id 14.3.339.0; Mon, 23 Apr 2018 05:01:52 -0700 Received: from CY1PR14MB0203.namprd14.prod.outlook.com (10.163.93.156) by CY1PR14MB0394.namprd14.prod.outlook.com (10.163.234.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Mon, 23 Apr 2018 12:01:38 +0000 Received: from CY1PR14MB0203.namprd14.prod.outlook.com ([fe80::9b2:7a86:23c0:3fd8]) by CY1PR14MB0203.namprd14.prod.outlook.com ([fe80::9b2:7a86:23c0:3fd8%13]) with mapi id 15.20.0696.017; Mon, 23 Apr 2018 12:01:37 +0000 From: "Tiainen, Antti" To: Xin Long , "libteam@lists.fedorahosted.org" , Jiri Pirko Subject: Re: [PATCHv2] libteam: do not destroy the ifinfo of current unregistered slave dev Thread-Topic: EXTERNAL: [PATCHv2] libteam: do not destroy the ifinfo of current unregistered slave dev Thread-Index: AQHT2iulxnYwaa41Qkm3rgfuS7kwBKQOO//5 Date: Mon, 23 Apr 2018 12:01:37 +0000 Message-ID: References: <064e21f1dc9a34e637411c9ecbcd833057994609.1524395891.git.lucien.xin@gmail.com> In-Reply-To: <064e21f1dc9a34e637411c9ecbcd833057994609.1524395891.git.lucien.xin@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [213.28.200.143] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY1PR14MB0394; 7:35800bINEmviD1wEBUXdXJV3SJk1EdFLWWoOjXCZc2hjXZQdDDOl7LQeBsQmecSxwYUVNguXkfH51FwdpRn7Pc0vYYid9PwPV98M3Exq5U9uWd8l4ipWzr7GGvObswdCIlOwjB/rljc9UEVdz7hbIUS3qcdCZy60cNbJ5ODim2Je/3hDv7IZ6ncfpY3tSSMSQAgJyuP40eVmvUwFrOgarhmDTqyBTd8EGVpiKkbHQhDvzsVn5HReMStCOSzouJe7 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY1PR14MB0394; x-ms-traffictypediagnostic: CY1PR14MB0394: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231232)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR14MB0394; BCL:0; PCL:0; RULEID:; SRVR:CY1PR14MB0394; x-forefront-prvs: 06515DA04B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(376002)(39380400002)(346002)(54534003)(74316002)(6606003)(39060400002)(229853002)(476003)(76176011)(25786009)(3280700002)(33656002)(2501003)(5250100002)(446003)(2900100001)(11346002)(6246003)(5660300001)(54896002)(53546011)(55016002)(186003)(478600001)(102836004)(7736002)(26005)(99286004)(53936002)(19627405001)(316002)(6506007)(3846002)(9686003)(86362001)(6116002)(8676002)(2906002)(81166006)(575784001)(66066001)(14454004)(7696005)(110136005)(3660700001)(6436002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR14MB0394; H:CY1PR14MB0203.namprd14.prod.outlook.com; FPR:; SPF:None; LANG:en; MLV:ovrnspm; PTR:InfoNoRecords; received-spf: None (protection.outlook.com: forcepoint.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: f5sBYQZYnIzro1P0HYrHGY3WaCWqZUB3xloTrDiowPNBt3AB6j3l8x0rKnvCN6ULiW123W5iefZLtjx2H9KL5+nK63HnXtq2lgy4T60OIss8sX8pKFrDnKSxI/BI07Cg0Ej+x/XqNKQVnmX3CfSFk6enGQb/gB3HjN2E0EOLFojSHoS8+nG/70P9fma5dTlV spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 14c3e072-6f33-4f2c-89f1-08d5a911f7c9 X-MS-Exchange-CrossTenant-Network-Message-Id: 14c3e072-6f33-4f2c-89f1-08d5a911f7c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2018 12:01:37.7949 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9ca08696-fd76-4782-a644-3c97f4dd0a59 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR14MB0394 X-OriginatorOrg: forcepoint.com Message-ID-Hash: HZG22TPDPMWC7EMXUJFQZ6N3II3GPQBP X-Message-ID-Hash: HZG22TPDPMWC7EMXUJFQZ6N3II3GPQBP X-MailFrom: atiainen@forcepoint.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-Virus-Scanned: ClamAV using ClamSMTP Strange, it doesn't crash for me if I try your example. But if I try with your patch, the deleted interface just hangs there in ifinfo list forever, even when change handlers are called. If this is only a debug print issue, it cannot do simply NULL check in there, and print something (or nothing) for the interface that's completely gone? -antti diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c index 5c32a9c..d47c2bf 100644 --- a/libteam/ifinfo.c +++ b/libteam/ifinfo.c @@ -211,7 +211,8 @@ void ifinfo_clear_changed(struct team_handle *th) struct team_ifinfo *ifinfo; list_for_each_node_entry(ifinfo, &th->ifinfo_list, list) - clear_changed(ifinfo); + if (!ifinfo->port) + clear_changed(ifinfo); } static struct team_ifinfo *ifinfo_find_create(struct team_handle *th, @@ -245,7 +246,7 @@ void ifinfo_destroy_removed(struct team_handle *th) struct team_ifinfo *ifinfo, *tmp; list_for_each_node_entry_safe(ifinfo, tmp, &th->ifinfo_list, list) { - if (is_changed(ifinfo, CHANGED_REMOVED)) + if (is_changed(ifinfo, CHANGED_REMOVED) && !ifinfo->port) ifinfo_destroy(ifinfo); } }