[{"id":1764282,"web_url":"http://patchwork.ozlabs.org/comment/1764282/","msgid":"<20170906183810.7096036b@cakuba.netronome.com>","list_archive_url":null,"date":"2017-09-06T17:38:10","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":17220,"url":"http://patchwork.ozlabs.org/api/people/17220/","name":"Jakub Kicinski","email":"kubakici@wp.pl"},"content":"On Wed,  6 Sep 2017 13:14:19 +0200, Jiri Pirko wrote:\n> From: Jiri Pirko <jiri@mellanox.com>\n> \n> There's a memleak happening for chain 0. The thing is, chain 0 needs to\n> be always present, not created on demand. Therefore tcf_block_get upon\n> creation of block calls the tcf_chain_create function directly. The\n> chain is created with refcnt == 1, which is not correct in this case and\n> causes the memleak. So move the refcnt increment into tcf_chain_get\n> function even for the case when chain needs to be created.\n> \n> Reported-by: Jakub Kicinski <kubakici@wp.pl>\n> Fixes: 5bc1701881e3 (\"net: sched: introduce multichain support for filters\")\n> Signed-off-by: Jiri Pirko <jiri@mellanox.com>\n\nTested-by: Jakub Kicinski <jakub.kicinski@netronome.com>","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=wp.pl header.i=@wp.pl header.b=\"lGcyuseA\";\n\tdkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnW5R3krKz9t2d\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 03:38:19 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752372AbdIFRiQ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 6 Sep 2017 13:38:16 -0400","from mx4.wp.pl ([212.77.101.12]:23077 \"EHLO mx4.wp.pl\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752335AbdIFRiO (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 6 Sep 2017 13:38:14 -0400","(wp-smtpd smtp.wp.pl 26691 invoked from network);\n\t6 Sep 2017 19:38:12 +0200","from host-79-78-33-110.static.as9105.net (HELO\n\tcakuba.netronome.com) (kubakici@wp.pl@[79.78.33.110])\n\t(envelope-sender <kubakici@wp.pl>)\n\tby smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted\n\tSMTP for <jiri@resnulli.us>; 6 Sep 2017 19:38:12 +0200"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a;\n\tt=1504719493; bh=I0u2SDunGM2HWMMLOsjN4uzlyMWSX184FyZXdUqdYv4=;\n\th=From:To:Cc:Subject;\n\tb=lGcyuseA0sFU6OgWYZhyLYPTUVrlEBLghgYHySHM3WbQ33VmQo0EDbX/himnNu94f\n\tehZKgX9HL4YvAav3ZqnqFdDoHWJlKS5p+IlOGWwVjKO8If/5fn1CWk8m2mpOhfSCKC\n\tqnSjrfMmBvnrW6mZy7Ais7Pir18lWZ8+xATGs+Rk=","Date":"Wed, 6 Sep 2017 18:38:10 +0100","From":"Jakub Kicinski <kubakici@wp.pl>","To":"Jiri Pirko <jiri@resnulli.us>","Cc":"netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com,\n\txiyou.wangcong@gmail.com, mlxsw@mellanox.com","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","Message-ID":"<20170906183810.7096036b@cakuba.netronome.com>","In-Reply-To":"<20170906111419.5115-1-jiri@resnulli.us>","References":"<20170906111419.5115-1-jiri@resnulli.us>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-WP-MailID":"eef5423b7b7d5427854e6b511645b66c","X-WP-AV":"skaner antywirusowy Poczty Wirtualnej Polski","X-WP-SPAM":"NO 000000A [wXNU]                               ","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1764283,"web_url":"http://patchwork.ozlabs.org/comment/1764283/","msgid":"<CAM_iQpWZJ9VVD66h6RMNofobKyoFyztx2jYqBEHuE6_iAu7PNQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-06T17:40:02","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Wed, Sep 6, 2017 at 4:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:\n> From: Jiri Pirko <jiri@mellanox.com>\n>\n> There's a memleak happening for chain 0. The thing is, chain 0 needs to\n> be always present, not created on demand. Therefore tcf_block_get upon\n> creation of block calls the tcf_chain_create function directly. The\n> chain is created with refcnt == 1, which is not correct in this case and\n> causes the memleak. So move the refcnt increment into tcf_chain_get\n> function even for the case when chain needs to be created.\n>\n\nYour approach could work but you just make the code even\nuglier than it is now:\n\n1. The current code is already ugly for special-casing chain 0:\n\n        if (--chain->refcnt == 0 && !chain->filter_chain && chain->index != 0)\n                tcf_chain_destroy(chain);\n\n2. With your patch, chain 0 has a different _initial_ refcnt with others.\n\n3. Allowing an object (chain 0) exists with refcnt==0\n\nCompare it with my patch:\n\n1. No special-case for chain 0, the above ugly part is removed\n\n2. Every chain is equal and created with refcnt==1\n\n3. Any chain with refcnt==0 is destroyed","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"uS5Z9Onp\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnW7v35FHz9t2d\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 03:40:27 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752422AbdIFRkY (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 6 Sep 2017 13:40:24 -0400","from mail-pg0-f66.google.com ([74.125.83.66]:36274 \"EHLO\n\tmail-pg0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752405AbdIFRkX (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 6 Sep 2017 13:40:23 -0400","by mail-pg0-f66.google.com with SMTP id d8so3794494pgt.3\n\tfor <netdev@vger.kernel.org>; Wed, 06 Sep 2017 10:40:23 -0700 (PDT)","by 10.100.140.134 with HTTP; Wed, 6 Sep 2017 10:40:02 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=q+GK+F73qMte5eDH1cxzDQlxnoyZAGruzdW6yhG7miM=;\n\tb=uS5Z9OnpQvSmAHD8E7mQ7YWdnW88zF7Hwrk4I4MtVtGPoJg2ZN+ed1E1bNw+HRYC0D\n\ti518XV4o6/ih2C9rHR95b/UAJSSA9mQTxwj2KdrgAZuDdGVpPtj4Q51SO14xZM3WKQU4\n\tbDsyoy0DpxnIJn4LKFIyiDxAhlC9UGM3hm6o6RpLnXH3jzFOyu0xpT8/yWCG26Ti7rjD\n\t/3fRg21T4Aeilc3R+Z//sj2SkCQKH/scrSYjHuqiCQbDbNhCTpLIjQqeUUATODs+6wpn\n\tyUF/qElFHTQkVgVCSpKPjRGAH/Zn0hssHJm6CS/wmf3k5jqwQe4aDNJFQ5UfCSo64b3y\n\tBslQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=q+GK+F73qMte5eDH1cxzDQlxnoyZAGruzdW6yhG7miM=;\n\tb=Qdqg/J5+775U/162yr6mBdPFPDqosVi1vwF8USyn1CMqdAGNumtZ4JjfZpA0tniYhi\n\tNnsXR1ylT3ei934T7u7iB0sb/QBm2FXZODHGUAlWVm6fWS+u1p/GTgSIosn0e8elq80l\n\tqLvLdJ+7uVxcBVTlUoKzZFMMUaOKY6DnDs6aZNzbLZzQOBppWg5zh/wKUkxh+EaiIdxC\n\tRHkJooKbhu5Phnl+y0GnZHCAl3+anj5WQWcfd8pENEbSUC4hp7MQ1xrq8YVJ5efXgNLi\n\tvyWit7VcYr+n7Oe4chRaWFQaFr/aWm2HSt4Sq60J2foFyHaPnN9ZVD8bKIdjgPAeBn3x\n\tMVag==","X-Gm-Message-State":"AHPjjUg4NKSf5H2pY6iJB7u3o6mAFXK/xMp5+4qMnyGIxiZzoLehtiHu\n\tUYSCVicTumhLSMJ5a8hkzXH9u7FRGXM7E/4=","X-Google-Smtp-Source":"ADKCNb5yiBSeHnAjOHRgRLOTKZxKcvTf3cmj1bHq7PfUobOnRIMVKs+QjjAbpCk3DKEYTqFDl5dcPOQX2jPbDAP7vE0=","X-Received":"by 10.98.26.74 with SMTP id a71mr8155815pfa.286.1504719622874;\n\tWed, 06 Sep 2017 10:40:22 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170906111419.5115-1-jiri@resnulli.us>","References":"<20170906111419.5115-1-jiri@resnulli.us>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Wed, 6 Sep 2017 10:40:02 -0700","Message-ID":"<CAM_iQpWZJ9VVD66h6RMNofobKyoFyztx2jYqBEHuE6_iAu7PNQ@mail.gmail.com>","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","To":"Jiri Pirko <jiri@resnulli.us>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tDavid Miller <davem@davemloft.net>, Jamal Hadi Salim <jhs@mojatatu.com>,\n\tJakub Kicinski <kubakici@wp.pl>, mlxsw@mellanox.com","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1764354,"web_url":"http://patchwork.ozlabs.org/comment/1764354/","msgid":"<20170906203323.GA16570@nanopsycho>","list_archive_url":null,"date":"2017-09-06T20:33:23","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":15321,"url":"http://patchwork.ozlabs.org/api/people/15321/","name":"Jiri Pirko","email":"jiri@resnulli.us"},"content":"Wed, Sep 06, 2017 at 07:40:02PM CEST, xiyou.wangcong@gmail.com wrote:\n>On Wed, Sep 6, 2017 at 4:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:\n>> From: Jiri Pirko <jiri@mellanox.com>\n>>\n>> There's a memleak happening for chain 0. The thing is, chain 0 needs to\n>> be always present, not created on demand. Therefore tcf_block_get upon\n>> creation of block calls the tcf_chain_create function directly. The\n>> chain is created with refcnt == 1, which is not correct in this case and\n>> causes the memleak. So move the refcnt increment into tcf_chain_get\n>> function even for the case when chain needs to be created.\n>>\n>\n>Your approach could work but you just make the code even\n>uglier than it is now:\n>\n>1. The current code is already ugly for special-casing chain 0:\n>\n>        if (--chain->refcnt == 0 && !chain->filter_chain && chain->index != 0)\n>                tcf_chain_destroy(chain);\n>\n>2. With your patch, chain 0 has a different _initial_ refcnt with others.\n\nNo. Initial refcnt is the same. ! for every action that holds the chain.\nSo actually, it returns it back where it should be.\n\n\n>\n>3. Allowing an object (chain 0) exists with refcnt==0\n\nSo? That is for every chain that does not have goto_chain action\npointing at. Please read the code.\n\n\n>\n>Compare it with my patch:\n>\n>1. No special-case for chain 0, the above ugly part is removed\n>\n>2. Every chain is equal and created with refcnt==1\n>\n>3. Any chain with refcnt==0 is destroyed","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=resnulli-us.20150623.gappssmtp.com\n\theader.i=@resnulli-us.20150623.gappssmtp.com\n\theader.b=\"gMhPR1QF\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnZzY6NLWz9t2c\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 06:33:29 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752534AbdIFUd1 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 6 Sep 2017 16:33:27 -0400","from mail-wr0-f196.google.com ([209.85.128.196]:35409 \"EHLO\n\tmail-wr0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752313AbdIFUd0 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 6 Sep 2017 16:33:26 -0400","by mail-wr0-f196.google.com with SMTP id n64so114536wrb.2\n\tfor <netdev@vger.kernel.org>; Wed, 06 Sep 2017 13:33:26 -0700 (PDT)","from localhost (ip-89-177-125-82.net.upcbroadband.cz.\n\t[89.177.125.82]) by smtp.gmail.com with ESMTPSA id\n\tr16sm608119wrb.43.2017.09.06.13.33.24\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 06 Sep 2017 13:33:24 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=resnulli-us.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=Fx+uWiZr/EyPTepxE/kg24ygY8gfjSsu0fy/K8CwxY8=;\n\tb=gMhPR1QFl50ZjRWh29KMTqFn7OwC1kxhFcTcSt78vIyJy8FuJNdrHeGeRRi15ZWXZy\n\tmVZ6/s9C8pNGfN6uQLpE2fuClmUsHSg9iyZX21c/XnzhDhiK/q9KCSOp6y8c+mR5Fmz4\n\tLHEI2i6uSYSb3Mj5EfOacDmTRNxgLTd7/R33KCfKEoYPfmlETkcwqOajGzj238tsbFjY\n\tKaXcY2S6N1l0VwPc7tz6BJymnxLK0saI0IDuwTBq94P1DpMpssOeIJHRWry8u0I1CRWa\n\tleQ3iLLDHCWsJW1qb3jCGw+pGTtBxrxzcZjlgoRAQO9qBP5IKV16ovgLVWygd5wC/wR1\n\tnURw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=Fx+uWiZr/EyPTepxE/kg24ygY8gfjSsu0fy/K8CwxY8=;\n\tb=Wo2fFGaLJsdk2TPpmFls9ovGVU0irAeY2EHiyesWKHaQqT2AgBxA/Fqi/vx9LG0a3W\n\tHTqJa0R51TL3dDD+xAGxD7je8FDU4tWiTPbBXvMS4XEdwfxhi7tLVZdFNLoLToKKlA2/\n\tdZgyDqnvHy8N8x/Lbxh2DmYaDDkhbIKr89AnIEfMWnAgwWXyziB7ah0z52eenuob2WU5\n\tfmWdv7tL+NWNNkK6ywNA7dn8lbDLwApgq6izSnzly2yG0x1ImsHSNkgdVpfhexBBpITE\n\teQLmYXY2XWyyO4sT9JJg26N0abicrieKB5rDuBMUYcie746rjLofxRuXOLxMwc8LrN8n\n\tzS8A==","X-Gm-Message-State":"AHPjjUhxm0AcuZsAl+WPXuOKHKyhwae/ETFYr3u4vSBQv0UcGHWfDW9s\n\tQkgBHxYuiKNBFx//","X-Google-Smtp-Source":"ADKCNb459Iu+zvfxSZOyIfIhn4oxbd80m5LkoDute99M/eECDnMrGVUlNX7ILHw8t8P04h+CwAcggQ==","X-Received":"by 10.223.138.235 with SMTP id z40mr111166wrz.14.1504730005676; \n\tWed, 06 Sep 2017 13:33:25 -0700 (PDT)","Date":"Wed, 6 Sep 2017 22:33:23 +0200","From":"Jiri Pirko <jiri@resnulli.us>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tDavid Miller <davem@davemloft.net>, Jamal Hadi Salim <jhs@mojatatu.com>,\n\tJakub Kicinski <kubakici@wp.pl>, mlxsw@mellanox.com","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","Message-ID":"<20170906203323.GA16570@nanopsycho>","References":"<20170906111419.5115-1-jiri@resnulli.us>\n\t<CAM_iQpWZJ9VVD66h6RMNofobKyoFyztx2jYqBEHuE6_iAu7PNQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<CAM_iQpWZJ9VVD66h6RMNofobKyoFyztx2jYqBEHuE6_iAu7PNQ@mail.gmail.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1764437,"web_url":"http://patchwork.ozlabs.org/comment/1764437/","msgid":"<CAM_iQpX8q8A-J+7w0rzxuZBrTYLmmgLgU1K=cH9-9f0ikkSaPw@mail.gmail.com>","list_archive_url":null,"date":"2017-09-06T23:37:59","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Wed, Sep 6, 2017 at 1:33 PM, Jiri Pirko <jiri@resnulli.us> wrote:\n> Wed, Sep 06, 2017 at 07:40:02PM CEST, xiyou.wangcong@gmail.com wrote:\n>>On Wed, Sep 6, 2017 at 4:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:\n>>> From: Jiri Pirko <jiri@mellanox.com>\n>>>\n>>> There's a memleak happening for chain 0. The thing is, chain 0 needs to\n>>> be always present, not created on demand. Therefore tcf_block_get upon\n>>> creation of block calls the tcf_chain_create function directly. The\n>>> chain is created with refcnt == 1, which is not correct in this case and\n>>> causes the memleak. So move the refcnt increment into tcf_chain_get\n>>> function even for the case when chain needs to be created.\n>>>\n>>\n>>Your approach could work but you just make the code even\n>>uglier than it is now:\n>>\n>>1. The current code is already ugly for special-casing chain 0:\n>>\n>>        if (--chain->refcnt == 0 && !chain->filter_chain && chain->index != 0)\n>>                tcf_chain_destroy(chain);\n>>\n>>2. With your patch, chain 0 has a different _initial_ refcnt with others.\n>\n> No. Initial refcnt is the same. ! for every action that holds the chain.\n> So actually, it returns it back where it should be.\n\nNot all all.\n\ntcf_block_get() calls tcf_chain_create(, 0), after your patch\nchain 0 has refcnt==0 initially.\n\nNon-0 chain? They are created via tcf_chain_get(), aka,\nrefcnt==0 initially.\n\n\n>\n>\n>>\n>>3. Allowing an object (chain 0) exists with refcnt==0\n>\n> So? That is for every chain that does not have goto_chain action\n> pointing at. Please read the code.\n\nSo you are pretending to be GC but you are apparently not.\n\nYou create all the troubles by setting yourself to believe chain 0\nis special and refcnt==0 is okay. Both are wrong.\n\nActually the !list_empty() check is totally unnecessary too,\nit is yet another place you get it wrong, you hide the race\ncondition in commit 744a4cf63e52 which makes it harder\nto expose.\n\nI understand you don't trust me. Look at DaveM's reaction\nto your refcnt==0 madness.\n\nRemember, refcnt can be very simple, you just want to\nmake it harder by abusing it or attempting to invent a GC.\n\nI am going to update my patch (to remove all your madness)\nsince this is horribly wrong to me. Sorry.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"k6odWmM+\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xng4v3782z9s7h\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 09:38:23 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752948AbdIFXiV (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 6 Sep 2017 19:38:21 -0400","from mail-pf0-f194.google.com ([209.85.192.194]:34331 \"EHLO\n\tmail-pf0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752525AbdIFXiU (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 6 Sep 2017 19:38:20 -0400","by mail-pf0-f194.google.com with SMTP id y68so3698293pfd.1\n\tfor <netdev@vger.kernel.org>; Wed, 06 Sep 2017 16:38:20 -0700 (PDT)","by 10.100.140.134 with HTTP; Wed, 6 Sep 2017 16:37:59 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=FdTMrWHXdM6pWmstVDeUIYGJe5r8z4bYx2nHsN7FAxo=;\n\tb=k6odWmM+M/Im2tfA0sb1gsjDDf/qwpMB6DmJdU8yC+p3T9Mf3JvAt7DZp+59cTAxr1\n\t/2xGNbKvg3neYwGBV+m8fkndNEAlV003cSt2XNULd8EfvJ0Ya8V7zJUr6vaXgPj1YlQG\n\tHa4gyIW1pbUIoEy1Ou3N8eVMUe47DrAfLPKdZf+Q452NX6o1etV6dczrmi+f1VINBMZ0\n\t7RNWiis40AjUhQYhr3Kg0XI1TSju3pM75WHhwpqJJipZxf+tOeV+htrOjqiLJ5xkyPPy\n\tINlOVK7WUbpFJ7rksix/w04nPVmvWH4pcLuuiwNayI8sJiS7BvM/l3Y4aHXDvTt39o3s\n\ta+8w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=FdTMrWHXdM6pWmstVDeUIYGJe5r8z4bYx2nHsN7FAxo=;\n\tb=kw7rWo5s2Ff6ecJ2BcIOWJfy36Czfogdda5vcddR34JayhYWiSeFgJh+k87okt6w16\n\t+xdUvtrxvomGnimDnDG9PMJtIvY9y/q1SQ9si2+wkB9dpwLcg3+6Bl5qtsqTJ9qSeF7o\n\tigFsglzYeYvX8P/w8fQa+ui8qPMpSH0lie/TLAFslHKxfky8dzsEpAY48aIhwpwKXrdO\n\tmAi/LLlr6HbGYHklwNdZE2oO9vQ65pwewUt3n6xFm1XOtKdAtNjy1NewuxJ1fkeqT+xH\n\t3iQ5vlryYo8ykD3b+G0eEB+sHkRnuuTCpEdiB7bmb41YmZhEU1/ESYp6yjqHHkbM9krz\n\tHItw==","X-Gm-Message-State":"AHPjjUigxdMRvfv+Xh+bJFWB76R6VGAvJjQnva8TEivmyuSFktpSKRJB\n\tbNW8ftIDh6F46H9xy3cORn0kvwVho26FRPY=","X-Google-Smtp-Source":"ADKCNb7eIZIBPCPal73kHcP85baHb30+N/z/6eDyR8fLvD0djHfEFXjUdmahaEDJhE0ku043xTfvwX8CVnb0EiHJqp4=","X-Received":"by 10.98.8.220 with SMTP id 89mr869173pfi.24.1504741099922; Wed,\n\t06 Sep 2017 16:38:19 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170906203323.GA16570@nanopsycho>","References":"<20170906111419.5115-1-jiri@resnulli.us>\n\t<CAM_iQpWZJ9VVD66h6RMNofobKyoFyztx2jYqBEHuE6_iAu7PNQ@mail.gmail.com>\n\t<20170906203323.GA16570@nanopsycho>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Wed, 6 Sep 2017 16:37:59 -0700","Message-ID":"<CAM_iQpX8q8A-J+7w0rzxuZBrTYLmmgLgU1K=cH9-9f0ikkSaPw@mail.gmail.com>","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","To":"Jiri Pirko <jiri@resnulli.us>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tDavid Miller <davem@davemloft.net>, Jamal Hadi Salim <jhs@mojatatu.com>,\n\tJakub Kicinski <kubakici@wp.pl>, mlxsw@mellanox.com","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1764522,"web_url":"http://patchwork.ozlabs.org/comment/1764522/","msgid":"<20170907060710.GA1967@nanopsycho>","list_archive_url":null,"date":"2017-09-07T06:07:10","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":15321,"url":"http://patchwork.ozlabs.org/api/people/15321/","name":"Jiri Pirko","email":"jiri@resnulli.us"},"content":"Thu, Sep 07, 2017 at 01:37:59AM CEST, xiyou.wangcong@gmail.com wrote:\n>On Wed, Sep 6, 2017 at 1:33 PM, Jiri Pirko <jiri@resnulli.us> wrote:\n>> Wed, Sep 06, 2017 at 07:40:02PM CEST, xiyou.wangcong@gmail.com wrote:\n>>>On Wed, Sep 6, 2017 at 4:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:\n>>>> From: Jiri Pirko <jiri@mellanox.com>\n>>>>\n>>>> There's a memleak happening for chain 0. The thing is, chain 0 needs to\n>>>> be always present, not created on demand. Therefore tcf_block_get upon\n>>>> creation of block calls the tcf_chain_create function directly. The\n>>>> chain is created with refcnt == 1, which is not correct in this case and\n>>>> causes the memleak. So move the refcnt increment into tcf_chain_get\n>>>> function even for the case when chain needs to be created.\n>>>>\n>>>\n>>>Your approach could work but you just make the code even\n>>>uglier than it is now:\n>>>\n>>>1. The current code is already ugly for special-casing chain 0:\n>>>\n>>>        if (--chain->refcnt == 0 && !chain->filter_chain && chain->index != 0)\n>>>                tcf_chain_destroy(chain);\n>>>\n>>>2. With your patch, chain 0 has a different _initial_ refcnt with others.\n>>\n>> No. Initial refcnt is the same. ! for every action that holds the chain.\n>> So actually, it returns it back where it should be.\n>\n>Not all all.\n>\n>tcf_block_get() calls tcf_chain_create(, 0), after your patch\n>chain 0 has refcnt==0 initially.\n>\n>Non-0 chain? They are created via tcf_chain_get(), aka,\n>refcnt==0 initially.\n\nAnd if they are created on insertion of the filter, put is caller right\naway which returns the ref back to 0. As I said, Non-0 refcnt means\neither rule is being inserted/removed of there is an action that holds\nreference to this chain. So my patch actually fixes the behaviour making\nchain 0 and other chains to behave the same.\n\n\n>\n>\n>>\n>>\n>>>\n>>>3. Allowing an object (chain 0) exists with refcnt==0\n>>\n>> So? That is for every chain that does not have goto_chain action\n>> pointing at. Please read the code.\n>\n>So you are pretending to be GC but you are apparently not.\n>\n>You create all the troubles by setting yourself to believe chain 0\n>is special and refcnt==0 is okay. Both are wrong.\n>\n>Actually the !list_empty() check is totally unnecessary too,\n>it is yet another place you get it wrong, you hide the race\n>condition in commit 744a4cf63e52 which makes it harder\n>to expose.\n>\n>I understand you don't trust me. Look at DaveM's reaction\n>to your refcnt==0 madness.\n>\n>Remember, refcnt can be very simple, you just want to\n>make it harder by abusing it or attempting to invent a GC.\n>\n>I am going to update my patch (to remove all your madness)\n>since this is horribly wrong to me. Sorry.\n\nIt is not so easy to use the refcnt also for filters, I had good reason\nto relend on filter_chain list to find out if there is a rule. If you\nfigure out how to do it better, be my guest. I suggest you do that for\nnet-next and let's fix the net in the easiest way possible.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=resnulli-us.20150623.gappssmtp.com\n\theader.i=@resnulli-us.20150623.gappssmtp.com\n\theader.b=\"H04Al9gI\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnqjd0fCxz9sRV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 16:07:16 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932066AbdIGGHO (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 7 Sep 2017 02:07:14 -0400","from mail-wr0-f194.google.com ([209.85.128.194]:35344 \"EHLO\n\tmail-wr0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1753942AbdIGGHN (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 7 Sep 2017 02:07:13 -0400","by mail-wr0-f194.google.com with SMTP id n64so522185wrb.2\n\tfor <netdev@vger.kernel.org>; Wed, 06 Sep 2017 23:07:12 -0700 (PDT)","from localhost (ip-89-177-125-82.net.upcbroadband.cz.\n\t[89.177.125.82]) by smtp.gmail.com with ESMTPSA id\n\tc1sm942122wre.84.2017.09.06.23.07.10\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 06 Sep 2017 23:07:11 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=resnulli-us.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=5b4t5ltgWH4iGcC+/x3Z9mNZloXJN4NZeDBT3r2O3S0=;\n\tb=H04Al9gIyZFtTDPWHBO0vvZW0kPUFeeAhC+i6sWTdsPkLYAHzMlYoVBGB2KdEG9tN+\n\tqqMQ1WgYskPPG7vnK8cBcDD44dAdmCHLJfYBwt3yMgZuWF6mnIps5TwbMIYCdVuT+vC5\n\txUMKB95iDb2yH1ss4Ib6zP+p61LWR6gE5noYj3eJPmzYcAJaAt4VSjA00MAEtFyhniAq\n\tAi/2mTM1X3JYNcqAzzsxOWo/O91cW8mU6urvIxoiPmy5+3knDJ1E4DZbrDtR/V1sq0wl\n\tYj3ehZkkP2v7pZFwAe9gze3eXOIWiHifRzG1b70ygZ7r1zcw37hDnw+uI5O2s0sg9dCw\n\tKldg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=5b4t5ltgWH4iGcC+/x3Z9mNZloXJN4NZeDBT3r2O3S0=;\n\tb=AZBSheEsKUwyPxhYAkiPOqE+z5Jn+fNyc5+e5Vb7UhzOyqJGrX4eRJn+UI8LmHwipV\n\tNF0RUSQEOJzU/q9E3aEQVNuIZaId/ZKpCxkjfa+DlZuAGCj/3zCtEMnG3a4FyopEAoVm\n\tPfFYzEZf3rmlU4Jzyvqs9ZCFuLfEcgwPQU89uMEkyx00pBiJzbH15YlnH9PZDcWth/Il\n\t8JumwIZdkXMd5KjxCdxgqGA39RM7HRGI2Sn3ZWlUaPthnBOFQlSH89CtZ16271D7g9xS\n\tKJcER6V74Lec3S0trYiHQVUqkyalQkm7RbNFrHRQMX+sf4QwV5OhlDBVMGIAEq4giV9A\n\tJgDw==","X-Gm-Message-State":"AHPjjUgZfoOMngE3eHkYUtPRDcGd4l8LQKP/CYC4KlvEzuoWEY4TgXJV\n\t8e0Q3YYR2JJ2FroM","X-Google-Smtp-Source":"ADKCNb6k4IaOGHvgwXABe7wUqJS8pR8qdPJW3clHYea18OsfGaotkBfDn7CUhCgdn2t3Hy+r+ddQ6g==","X-Received":"by 10.223.152.6 with SMTP id v6mr989173wrb.40.1504764431857;\n\tWed, 06 Sep 2017 23:07:11 -0700 (PDT)","Date":"Thu, 7 Sep 2017 08:07:10 +0200","From":"Jiri Pirko <jiri@resnulli.us>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tDavid Miller <davem@davemloft.net>, Jamal Hadi Salim <jhs@mojatatu.com>,\n\tJakub Kicinski <kubakici@wp.pl>, mlxsw@mellanox.com","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","Message-ID":"<20170907060710.GA1967@nanopsycho>","References":"<20170906111419.5115-1-jiri@resnulli.us>\n\t<CAM_iQpWZJ9VVD66h6RMNofobKyoFyztx2jYqBEHuE6_iAu7PNQ@mail.gmail.com>\n\t<20170906203323.GA16570@nanopsycho>\n\t<CAM_iQpX8q8A-J+7w0rzxuZBrTYLmmgLgU1K=cH9-9f0ikkSaPw@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<CAM_iQpX8q8A-J+7w0rzxuZBrTYLmmgLgU1K=cH9-9f0ikkSaPw@mail.gmail.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1765043,"web_url":"http://patchwork.ozlabs.org/comment/1765043/","msgid":"<20170907.191800.218886770521884093.davem@davemloft.net>","list_archive_url":null,"date":"2017-09-08T02:18:00","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":15,"url":"http://patchwork.ozlabs.org/api/people/15/","name":"David Miller","email":"davem@davemloft.net"},"content":"From: Jiri Pirko <jiri@resnulli.us>\nDate: Wed,  6 Sep 2017 13:14:19 +0200\n\n> From: Jiri Pirko <jiri@mellanox.com>\n> \n> There's a memleak happening for chain 0. The thing is, chain 0 needs to\n> be always present, not created on demand. Therefore tcf_block_get upon\n> creation of block calls the tcf_chain_create function directly. The\n> chain is created with refcnt == 1, which is not correct in this case and\n> causes the memleak. So move the refcnt increment into tcf_chain_get\n> function even for the case when chain needs to be created.\n> \n> Reported-by: Jakub Kicinski <kubakici@wp.pl>\n> Fixes: 5bc1701881e3 (\"net: sched: introduce multichain support for filters\")\n> Signed-off-by: Jiri Pirko <jiri@mellanox.com>\n\nThis doesn't apply cleanly any more, please respin.\n\nThanks Jiri.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpLZh4sQNz9s83\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 12:18:04 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753752AbdIHCSC (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 7 Sep 2017 22:18:02 -0400","from shards.monkeyblade.net ([184.105.139.130]:40756 \"EHLO\n\tshards.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1753161AbdIHCSB (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 7 Sep 2017 22:18:01 -0400","from localhost (74-93-104-98-Washington.hfc.comcastbusiness.net\n\t[74.93.104.98]) (using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\t(Authenticated sender: davem-davemloft)\n\tby shards.monkeyblade.net (Postfix) with ESMTPSA id A217A13408B0C;\n\tThu,  7 Sep 2017 19:18:00 -0700 (PDT)"],"Date":"Thu, 07 Sep 2017 19:18:00 -0700 (PDT)","Message-Id":"<20170907.191800.218886770521884093.davem@davemloft.net>","To":"jiri@resnulli.us","Cc":"netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com,\n\tkubakici@wp.pl, mlxsw@mellanox.com","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","From":"David Miller <davem@davemloft.net>","In-Reply-To":"<20170906111419.5115-1-jiri@resnulli.us>","References":"<20170906111419.5115-1-jiri@resnulli.us>","X-Mailer":"Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO)","Mime-Version":"1.0","Content-Type":"Text/Plain; charset=us-ascii","Content-Transfer-Encoding":"7bit","X-Greylist":"Sender succeeded SMTP AUTH, not delayed by\n\tmilter-greylist-4.5.12 (shards.monkeyblade.net\n\t[149.20.54.216]); Thu, 07 Sep 2017 19:18:00 -0700 (PDT)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1765835,"web_url":"http://patchwork.ozlabs.org/comment/1765835/","msgid":"<CAM_iQpXSjXWPw9QY7VHGnKssLHCBSJq4XnS2KPTheLB7_rBF7g@mail.gmail.com>","list_archive_url":null,"date":"2017-09-09T18:46:42","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Thu, Sep 7, 2017 at 7:18 PM, David Miller <davem@davemloft.net> wrote:\n>\n> This doesn't apply cleanly any more, please respin.\n>\n\nSigh, you applied this patch despite of strong objections from me.\n\nI seriously doubt your tastes now, David. Fine, this code does not\ndeserve a good taste at all, let bugs stay there.\n\nGood luck!","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"J2CB9Fvs\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqNTW4rkdz9t3C\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 10 Sep 2017 04:47:11 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1750902AbdIISrE (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 9 Sep 2017 14:47:04 -0400","from mail-pg0-f65.google.com ([74.125.83.65]:33365 \"EHLO\n\tmail-pg0-f65.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750763AbdIISrD (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 9 Sep 2017 14:47:03 -0400","by mail-pg0-f65.google.com with SMTP id i130so775802pgc.0\n\tfor <netdev@vger.kernel.org>; Sat, 09 Sep 2017 11:47:02 -0700 (PDT)","by 10.100.160.131 with HTTP; Sat, 9 Sep 2017 11:46:42 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=7pT5IXkrzCl2thatgLruq/bapRZMvyyI7NUfJjtX3Mw=;\n\tb=J2CB9FvsPw+2hsIdJJ22NTZFBVhZUp0T5CTPawk4sj5I8maTIG9T+wITAHH5QI3PET\n\tub57BVMjpn6t1mP6b4yun1REkPDSl2zmYz20i8PNb+We8gcxZ1rpLwDNYQIFX55NT2yQ\n\tXrWWbZYLtTTByyOAP85+DjtFNnYYtsnFxlrkuI/rIWSpthEkE9PI8iQFY5ci1E51Ii0S\n\tfjulsiesnWq/yaTS9k5knq1tIQO5GYtAAJcOtMYKuDoJavtKkFgGn2Zv0IsUE3v20+ag\n\tbfT1xSBSGksJ033Do7Uk2PDZmRV+lmhPiDAOUWMk5Tow7M5BsRfs2qWhlY6OEQhXY5RD\n\tuP0w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=7pT5IXkrzCl2thatgLruq/bapRZMvyyI7NUfJjtX3Mw=;\n\tb=ddUHd9jkBPpx4OpkjIIAC4qFHylaBIK8iSRJhjmVbTiKrXLHkEPICn0nFtf79XjSr0\n\t84DDnC+AEdZCsS6F6rvzRzNgUX8BQjJwHZ4VAnf19+55eQjzc++m0DkMbrBlHDH3UU63\n\th8gB6UWj+hJ+GGpc24SpJRY9Yq4YLm6sNruHblnslfZZPs7+cAPKJXZged7rjsojxDWQ\n\tZ5KavHA7DszOfsDpSuFUafUyPt3h0bC4Z+eCTlezQwyaccojGH670XdhgIfEWJvR30h0\n\tpCI4AXrO8QDKfCrVHvYAUjmtPw4A36AqqbhDB8P1OTPLRVLYl0vJu2lbUZbxq5MCjeLj\n\twWSA==","X-Gm-Message-State":"AHPjjUj95KtfpAcFwaB1ag97H9G9UKJ66ZALpmtFPPJKOGCGs8+haKy/\n\tgTZVclmjy0eYFmGi20UKWZPuVn0grA==","X-Google-Smtp-Source":"ADKCNb6Eqh7gmXInbG5q0ODiJ70wROuB78ReX1QdbOgaHT+3mpF4sdJazzL9Tcv4VzpQE0uiDdfl9mbZwoNNnv/IBPM=","X-Received":"by 10.98.25.193 with SMTP id 184mr206570pfz.24.1504982822656;\n\tSat, 09 Sep 2017 11:47:02 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170907.191800.218886770521884093.davem@davemloft.net>","References":"<20170906111419.5115-1-jiri@resnulli.us>\n\t<20170907.191800.218886770521884093.davem@davemloft.net>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Sat, 9 Sep 2017 11:46:42 -0700","Message-ID":"<CAM_iQpXSjXWPw9QY7VHGnKssLHCBSJq4XnS2KPTheLB7_rBF7g@mail.gmail.com>","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","To":"David Miller <davem@davemloft.net>","Cc":"Jiri Pirko <jiri@resnulli.us>,\n\tLinux Kernel Network Developers <netdev@vger.kernel.org>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\tJakub Kicinski <kubakici@wp.pl>, mlxsw@mellanox.com","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1765945,"web_url":"http://patchwork.ozlabs.org/comment/1765945/","msgid":"<20170910140338.GA1860@nanopsycho>","list_archive_url":null,"date":"2017-09-10T14:03:38","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":15321,"url":"http://patchwork.ozlabs.org/api/people/15321/","name":"Jiri Pirko","email":"jiri@resnulli.us"},"content":"Sat, Sep 09, 2017 at 08:46:42PM CEST, xiyou.wangcong@gmail.com wrote:\n>On Thu, Sep 7, 2017 at 7:18 PM, David Miller <davem@davemloft.net> wrote:\n>>\n>> This doesn't apply cleanly any more, please respin.\n>>\n>\n>Sigh, you applied this patch despite of strong objections from me.\n>\n>I seriously doubt your tastes now, David. Fine, this code does not\n>deserve a good taste at all, let bugs stay there.\n\nActually, the reported bug is resolved by this patch. I like your\napproach Cong, we can make it work and follow-up on this patch.\nPlease stay calm and be patient...","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=resnulli-us.20150623.gappssmtp.com\n\theader.i=@resnulli-us.20150623.gappssmtp.com\n\theader.b=\"B1cTa016\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqt8133x9z9s72\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 11 Sep 2017 00:03:45 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751804AbdIJODn (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 10 Sep 2017 10:03:43 -0400","from mail-wr0-f193.google.com ([209.85.128.193]:35773 \"EHLO\n\tmail-wr0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751756AbdIJODm (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sun, 10 Sep 2017 10:03:42 -0400","by mail-wr0-f193.google.com with SMTP id n64so3268903wrb.2\n\tfor <netdev@vger.kernel.org>; Sun, 10 Sep 2017 07:03:41 -0700 (PDT)","from localhost (jirka.pirko.cz. [84.16.102.26])\n\tby smtp.gmail.com with ESMTPSA id\n\ts196sm9532532wmb.6.2017.09.10.07.03.38\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSun, 10 Sep 2017 07:03:39 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=resnulli-us.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=mOoKC4eotWTVG17+sTq33Kwnzf8mkFuAz9FIiyXqkkg=;\n\tb=B1cTa016WVSKQxKWyG+cEqMoWozNO/b5vNHmLnHWkeLFdDxeVs3Wd8s8l3pWARcYvT\n\tLS7zXtaDjvFsywLDcd5u2wOHpxl2Ic+j0l5QkZHnKMPUclnBLYG7sWuY1yNlPtH/xgam\n\tr6dd3yN88t38u6ZwmHVBJ2DyNipoW/t2ppzwzXvxHlv9ZA3qZFVWFNW8DGJC5B5XwbDU\n\txKlfKPcKya4dvztIyN9NFKcxMq455kpVjgQfyBjJSPiExoErkWSubEVd6a1Orbp0SRdR\n\tV995EQEEL/GKRGlddo8vH0Qdn81Av58t6vpSLmMvjvF6vhXzLwUFFiN+l88TK3q87L3z\n\tNJeg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=mOoKC4eotWTVG17+sTq33Kwnzf8mkFuAz9FIiyXqkkg=;\n\tb=cwmUpmxmHltCwiMVByBTLingxzSToXBZ09yNzZR/FUfbF9heCamWIB06DDCVmPWRdi\n\t21myqeBZI+YobC3jnap/uGvFjgJWV6JwA+UqJj1DIUXHhuQ/pvC44LnJDJqeB5aXqUCP\n\tkHGobGoXgu94SFMknPyj+ACPaWx3bV2s2WTrEep4ZJAEa/s0UrRpx3h64D31I+5hdF7j\n\tqkNNcSu+5yBMu4jXxdVly1Ga3fz245HevAmMnpgEpomqgRAz0+63XJIDulKsOWEGGjqt\n\tGxlsR6uzVBKFEr3rUikJ9Tti3cDmOkaPwZEJvRrht8TL42xKb9mpEyqIqVYCK/ZhuLw4\n\tpcPg==","X-Gm-Message-State":"AHPjjUiIPA5i2jmum0MOUr35re+v8AjemP5x2+VcUbDqzVoF2VhzxV4V\n\tcYTb4dGwQArQETQ1","X-Google-Smtp-Source":"ADKCNb7qK2kJHOigzh12A95Wl9yOM9c55u6EHxWDxVNeZxifCGGbp6O2/UYxxPb612sC/A1eyYQdBQ==","X-Received":"by 10.223.169.51 with SMTP id u48mr6256034wrc.270.1505052221078; \n\tSun, 10 Sep 2017 07:03:41 -0700 (PDT)","Date":"Sun, 10 Sep 2017 16:03:38 +0200","From":"Jiri Pirko <jiri@resnulli.us>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"David Miller <davem@davemloft.net>,\n\tLinux Kernel Network Developers <netdev@vger.kernel.org>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\tJakub Kicinski <kubakici@wp.pl>, mlxsw@mellanox.com","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","Message-ID":"<20170910140338.GA1860@nanopsycho>","References":"<20170906111419.5115-1-jiri@resnulli.us>\n\t<20170907.191800.218886770521884093.davem@davemloft.net>\n\t<CAM_iQpXSjXWPw9QY7VHGnKssLHCBSJq4XnS2KPTheLB7_rBF7g@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<CAM_iQpXSjXWPw9QY7VHGnKssLHCBSJq4XnS2KPTheLB7_rBF7g@mail.gmail.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1766624,"web_url":"http://patchwork.ozlabs.org/comment/1766624/","msgid":"<CAM_iQpX3dpZHrcxt8irEHYeAEyGxw+S1GhVAX31gNTs89f0XPA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-11T23:43:20","subject":"Re: [patch net] net: sched: fix memleak for chain zero","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Sun, Sep 10, 2017 at 7:03 AM, Jiri Pirko <jiri@resnulli.us> wrote:\n> Sat, Sep 09, 2017 at 08:46:42PM CEST, xiyou.wangcong@gmail.com wrote:\n>>On Thu, Sep 7, 2017 at 7:18 PM, David Miller <davem@davemloft.net> wrote:\n>>>\n>>> This doesn't apply cleanly any more, please respin.\n>>>\n>>\n>>Sigh, you applied this patch despite of strong objections from me.\n>>\n>>I seriously doubt your tastes now, David. Fine, this code does not\n>>deserve a good taste at all, let bugs stay there.\n>\n> Actually, the reported bug is resolved by this patch. I like your\n> approach Cong, we can make it work and follow-up on this patch.\n> Please stay calm and be patient...\n\nOK. I already rebased my patches and sent v3.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"UfrTnwvx\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xrkyr0KzXz9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 12 Sep 2017 09:43:48 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751258AbdIKXnm (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 11 Sep 2017 19:43:42 -0400","from mail-pf0-f193.google.com ([209.85.192.193]:36705 \"EHLO\n\tmail-pf0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751153AbdIKXnl (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 11 Sep 2017 19:43:41 -0400","by mail-pf0-f193.google.com with SMTP id f84so5528684pfj.3\n\tfor <netdev@vger.kernel.org>; Mon, 11 Sep 2017 16:43:41 -0700 (PDT)","by 10.100.160.131 with HTTP; Mon, 11 Sep 2017 16:43:20 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=zbXeecCJWYc59BM46w+eVc54/6qC/ab1iPoDsMLlo6I=;\n\tb=UfrTnwvxC2w60zv+1StmYpH2QHyy3CxmnLkQTkn9h/2RuZZnUNZZz4Ju+CAMTYpZHJ\n\txVsNi4vo4JkxQ0vCwdcORbCBGXGzifGaURQQ3dBgla9F0WYQJKcEeQKj7bCPzGitPHAT\n\tb4a1ePzkGW9/brHnqatUpCYkJ+CEVGfS5glPdSEQdwTB3mgr555Gd6fnwxj/z8CyWnTK\n\tMttM4kixDcCUnoQq79AbnhRm1YwgxefSd0ehfieriCb17DFgWHpdmsgJ6FCQVo7WLHK6\n\tvLSoA6D6q1BbEj0vxupF0N2aezqDFlExtqVdCUZ60Tscw+y3j8QIO2eh2rElq2sBghtX\n\t5v3g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=zbXeecCJWYc59BM46w+eVc54/6qC/ab1iPoDsMLlo6I=;\n\tb=QYHfx78IUEm6U95trUbH0N0l5PzEKT8PXMt4uAJcKUfimphDma8ZCtF7QORHrYehyy\n\tT0N+AH7dFi23MNcgXth+s0yawk6h1hAG+FmAfEeW5yNSTwSLatAHUSKvAe3AQ7S/sCRD\n\twG4Job7qA7Rr+KYLhfC/5rrIDBgBK+vvJa2fWK3Mi2D8RfW6E9i9qSWG1SojS++yGwW9\n\tomvrNQ5RLcfqj44se8qPOtr42dDx4aaJg6EPTm6Em485sHpe4r7k2dQMd12SIK2yPCJg\n\tLbxta8BvQGU6S9suqUeRszr+hdfycg+7/nDEdOk9mnNseVVIH1KDr74g1ttSVy9vz8nC\n\tudiA==","X-Gm-Message-State":"AHPjjUhwmq4khVC3i5OYdM32v6zs4sAgzYKk1YFxPl52xt/Ch5vV46+L\n\tEYtscXeXEaYAM9F3DJFiLPU6tagF8dNH","X-Google-Smtp-Source":"ADKCNb5i4Or3Qnf4zdvWy6FPQj7TZOSL6w16MVGfkgGL+px6S38Mh3ffIK1j2q3jw/KGLctXM1PVy9eZHAhbLtZBz/s=","X-Received":"by 10.98.163.153 with SMTP id q25mr13021048pfl.183.1505173421384;\n\tMon, 11 Sep 2017 16:43:41 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170910140338.GA1860@nanopsycho>","References":"<20170906111419.5115-1-jiri@resnulli.us>\n\t<20170907.191800.218886770521884093.davem@davemloft.net>\n\t<CAM_iQpXSjXWPw9QY7VHGnKssLHCBSJq4XnS2KPTheLB7_rBF7g@mail.gmail.com>\n\t<20170910140338.GA1860@nanopsycho>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Mon, 11 Sep 2017 16:43:20 -0700","Message-ID":"<CAM_iQpX3dpZHrcxt8irEHYeAEyGxw+S1GhVAX31gNTs89f0XPA@mail.gmail.com>","Subject":"Re: [patch net] net: sched: fix memleak for chain zero","To":"Jiri Pirko <jiri@resnulli.us>","Cc":"David Miller <davem@davemloft.net>,\n\tLinux Kernel Network Developers <netdev@vger.kernel.org>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\tJakub Kicinski <kubakici@wp.pl>, mlxsw@mellanox.com","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]