From patchwork Sun Apr 29 12:28:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tiainen, Antti" X-Patchwork-Id: 10370537 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 199C960384 for ; Sun, 29 Apr 2018 12:28:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7CA628B56 for ; Sun, 29 Apr 2018 12:28:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB55A28B59; Sun, 29 Apr 2018 12:28:42 +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 E7EA328B56 for ; Sun, 29 Apr 2018 12:28:41 +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 AA5D1607A1D6; Sun, 29 Apr 2018 12:28:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.phx2.fedoraproject.org AA5D1607A1D6 Received: from mailman01.phx2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id 9C78725712B03; Sun, 29 Apr 2018 12:28:40 +0000 (UTC) Received: by mailman01.phx2.fedoraproject.org (Postfix, from userid 991) id 250DF25712B03; Sun, 29 Apr 2018 12:28:37 +0000 (UTC) Received: from smtp-mm-osuosl01.fedoraproject.org (smtp-mm-osuosl01.vpn.fedoraproject.org [192.168.1.23]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id 13FE725712B02 for ; Sun, 29 Apr 2018 12:28:36 +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-osuosl01.fedoraproject.org (Postfix) with ESMTPS id BB47198069 for ; Sun, 29 Apr 2018 12:28:35 +0000 (UTC) Received: from SSDEXCH2B.websense.com (unknown [10.64.80.131]) by Forcepoint Email with ESMTPS id 55B2F79A951A8CAC9274; Sun, 29 Apr 2018 05:28:34 -0700 (PDT) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (216.32.181.180) by webmail.websense.com (10.64.80.131) with Microsoft SMTP Server (TLS) id 14.3.339.0; Sun, 29 Apr 2018 05:28:34 -0700 Received: from CY1PR14MB0203.namprd14.prod.outlook.com (10.163.93.156) by CY1PR14MB0016.namprd14.prod.outlook.com (10.162.46.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.18; Sun, 29 Apr 2018 12:28:31 +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.0715.018; Sun, 29 Apr 2018 12:28:31 +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//5gAU2OuOABEKTQw== Date: Sun, 29 Apr 2018 12:28:31 +0000 Message-ID: References: <064e21f1dc9a34e637411c9ecbcd833057994609.1524395891.git.lucien.xin@gmail.com>, , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [80.220.84.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY1PR14MB0016; 7:UZKWYblHo46OOell5pAElcEaotN+i7dLNkQKiQjNVvzAgEUkkNckyCjeAjXjt/I6qwcO7VQJuko85rHGqDxTcrxYvSgvZIrBBR7GDjigyjekZOaqkApUxqIn0icDzNHbY6FWg3qzwH+X548PtLOH8ah86wP3VnijlLK8KSGAAsDoQ+Wjonmexg28dGbZDqdKE2Gfo2zuUQM3/b6MeW34DyfL9oiUyWWLB4UScSmk6mtwy7vP82NqiGJBxAyb4fU9 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:CY1PR14MB0016; x-ms-traffictypediagnostic: CY1PR14MB0016: 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)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:CY1PR14MB0016; BCL:0; PCL:0; RULEID:; SRVR:CY1PR14MB0016; x-forefront-prvs: 0657D528EC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(376002)(39850400004)(346002)(366004)(39380400002)(396003)(189003)(199004)(54534003)(446003)(76176011)(11346002)(53546011)(478600001)(6436002)(81156014)(2900100001)(8936002)(33656002)(476003)(8676002)(6606003)(102836004)(19627405001)(25786009)(81166006)(66066001)(316002)(26005)(39060400002)(68736007)(99286004)(14454004)(7696005)(186003)(74316002)(6246003)(6506007)(9686003)(55016002)(110136005)(59450400001)(54896002)(53936002)(7736002)(486006)(3280700002)(86362001)(575784001)(3660700001)(5660300001)(97736004)(5250100002)(3846002)(6116002)(2501003)(2906002)(229853002)(106356001)(105586002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR14MB0016; H:CY1PR14MB0203.namprd14.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: forcepoint.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: D8PP0tZ075faY5mxjqGYn4eGhd1V7WcUhYACCAFMP9/40lktgOnsENf5TKzA3uQBCXFh4FE9DE6LkA5/Bvw+XikRrCZ1A68C+V2VskyRvaWImh+teQ0bYuB2hF69GU1DxvAiWMANfD/lnfpCZczHy/8Pn28e3lqQXdeyONMLZfZd/b7Fqm253P1pwl5dwu2A spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 550d7037-6189-4b53-5ea9-08d5adccb7dd X-MS-Exchange-CrossTenant-Network-Message-Id: 550d7037-6189-4b53-5ea9-08d5adccb7dd X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2018 12:28:31.1683 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9ca08696-fd76-4782-a644-3c97f4dd0a59 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR14MB0016 X-OriginatorOrg: forcepoint.com Message-ID-Hash: 5TPYBKILFNDU2PMGD7FPHGG525HKTEGX X-Message-ID-Hash: 5TPYBKILFNDU2PMGD7FPHGG525HKTEGX 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 I sent my suggestion how to fix this. I don't have any objections to Xin Long's patch either, so maybe mr. Pirko you decide how we handle this. I can see that this is reported in Red Hat Bugzilla, so it's important that the crash is fixed now some way. -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); } }