Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp119458pxf; Tue, 30 Mar 2021 21:42:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh6X39S68YiFc2+QX+Ptu32PxO6d9fz8DMUi80lTorLGUQ9gVBtzpLF0iMJhVXbB9Eaf5e X-Received: by 2002:a17:906:dbd0:: with SMTP id yc16mr1506753ejb.71.1617165766042; Tue, 30 Mar 2021 21:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617165766; cv=none; d=google.com; s=arc-20160816; b=nxxSmLIxgJV7oXdi/CACXLQiBa7UkJ3SohyXdDVjm4/u1nbxdPjx2WRRnFS40+hpyY 1Mq390Pr3AOzMC/SsxvTSvzDzLW83C/T7TxAi25A0B58bpuvMDFHk+RFfkcUub1wIrdL mLw/mIFndKbiu2BeCnyznLqZdVnOE7oKmc/YeqZcGmWTBIliVNZl6nDx4RMbUqH/pbYZ wjhaxIJgkf7+kq2h4fsUXU+uWP7ufR9DV1nRClq7doHAwCZNYzOtA2fq2EC4NSIgF9Je M+s+YtkocFVF23dyWKiJv2boDNmyJLxi4LNp6a79XblxJjOfwS7wGhndQwjL6wjCAfbf BXiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=X6eY81cRt6EiGMhoMyYvfGPdOh1xN5EvDeFMwXUiigg=; b=aqH1mkGBnSkmQbpj9LSf29QKB6jxpuL1W0W816fUucFcXTWTUS4WcM4VpgqxAbPVIK Ew5ujf86PteJIiP+5yqAAaNsmqHmZw4xFcgT45+2m2i3NMtOwURHkkM5U7S55Sj/Ck4k UZHK5rGSGRM++xCO0yj5Xx2VaOc0weESysvuMtOuOzoZE31IRlSE0EC+xtGvl04pIBSt UuEDT4yz2fUwItDwOHjYIA5B0QR5MW6EcY03Hzqp8Q9wmjYRHSxghXeLcg+bAonErYty X7QsfUDPQk+ljE+/7AiB0CXqNMfksvHzi17RtoASHj9SIg5IcQZ8lfr8lHozMqSb2BbH AsJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BBqAgqWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i60si868578edd.577.2021.03.30.21.42.23; Tue, 30 Mar 2021 21:42:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BBqAgqWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232805AbhCaElE (ORCPT + 99 others); Wed, 31 Mar 2021 00:41:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbhCaEk5 (ORCPT ); Wed, 31 Mar 2021 00:40:57 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F949C061574; Tue, 30 Mar 2021 21:40:57 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id v10so8304055pfn.5; Tue, 30 Mar 2021 21:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X6eY81cRt6EiGMhoMyYvfGPdOh1xN5EvDeFMwXUiigg=; b=BBqAgqWos6JCoxi8NNnsgva5ECiAX69VIkMl5jiW/l7ozMFZTTfrnqLI6TwSWXp2+N mdm2LZnmmaEoQHB6b4HSWAKIbvJOKNx7zyLReQEb8XA3VCvP0TvIar6/zCu43yjG+oLA S+IDkjkPSZCLzzNOozz7m73F7A3LIq9tSyZtivj/kmd4+rYXlViQUi1edyDeGDIPvGZ0 9/Kau/4W64XM5FyAMhwIq9PIP5fdgtLmBtLFUsvhiOtOc744ceINwhYQpHjjPKrKrToP YFcfgdW3hhh/I51eljcBLU/qtxhh+pGCMC41OVz3kpysvc86Qyjm1jbpR/Sf2XvbzGKl WTmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X6eY81cRt6EiGMhoMyYvfGPdOh1xN5EvDeFMwXUiigg=; b=MeM/x/B7E5ucz0D6fyzxtl+zSAoxyPzLwSfjRaWsCwC7WlT7TSuyDGTTAPGTzNTuBV NA9QQS0LLrj8JcooPxlhBsPkNXZqiPwDyQko/XVP8x6ImmhIsG/PEI1/ITq1uw56jysW skDjNLSSD9/+Qx3tTX4q7062NL7U0mLqp9DxhdjLJgdw664OECt5eVHYFnBDR+zWm6PR FT6M1NaEAYlZwM0amWjfvts8QiMzlfud3su0XhQYvVYSRlg2CP/zNRhTO8ecyaBpfbks cBz7Tfw5eqpI0VNSOsrkRjly7DJHvm0llnIDZG1lPRtplVUvzSeO/gsFDLc5Qm8kRXJ6 qiQA== X-Gm-Message-State: AOAM533zXNE1gud/bd2ZZpwWabgNu9Mmo5wdeR3Jl7mAw3HdWk8R4MXh k6ijtLcni/xMP2EJsPbu4C+lgzClLO/+vcegbec= X-Received: by 2002:a63:6a41:: with SMTP id f62mr1402263pgc.428.1617165656183; Tue, 30 Mar 2021 21:40:56 -0700 (PDT) MIME-Version: 1.0 References: <20210329225322.143135-1-memxor@gmail.com> In-Reply-To: <20210329225322.143135-1-memxor@gmail.com> From: Cong Wang Date: Tue, 30 Mar 2021 21:40:45 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] net: sched: bump refcount for new action in ACT replace mode To: Kumar Kartikeya Dwivedi Cc: Vlad Buslov , David Miller , Jamal Hadi Salim , Jiri Pirko , Jakub Kicinski , LKML , Linux Kernel Network Developers , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 29, 2021 at 3:55 PM Kumar Kartikeya Dwivedi wrote: > diff --git a/net/sched/act_api.c b/net/sched/act_api.c > index b919826939e0..43cceb924976 100644 > --- a/net/sched/act_api.c > +++ b/net/sched/act_api.c > @@ -1042,6 +1042,9 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp, > if (err != ACT_P_CREATED) > module_put(a_o->owner); > > + if (!bind && ovr && err == ACT_P_CREATED) > + refcount_set(&a->tcfa_refcnt, 2); > + Hmm, if we set the refcnt to 2 here, how could tcf_action_destroy() destroy them when we rollback from a failure in the middle of the loop in tcf_action_init()? Thanks.