Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp228769pxf; Wed, 31 Mar 2021 01:39:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIXQuy6K4zZPQvJoYeHpnt0AF/g1Jpj7TPPx1WwauE3ErdOSg94XbPiuIqrRRI8aTQHM4v X-Received: by 2002:a05:6402:1342:: with SMTP id y2mr2292049edw.285.1617179984185; Wed, 31 Mar 2021 01:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617179984; cv=none; d=google.com; s=arc-20160816; b=Tj+wgLGqFr9ciM4HvewIxiyMybcrZVFrXJXrOrUvzFNYqZAbWP3O8Dqsg/A6UUC1/n 2e4z3N+5uJQyD+e97tHea54riJa4SJ44YfW4Dd4C22uyiWGTK/WlNBiBbU5xQ5YSpEHA GxFY+VOMSJSwpLe9idFOh2HkxZyesxTYv4ILfN8e9fIDPBVvmxg1O6rdCZrHmUWq+FwX kSPwHnWh5qI//P52JQY1jGKGPIwpGiekhcBvpEahC7KHhz1jKgmpuBRKFIpnVI5S3rv+ coUBpYNo59u0W+dLpcObKQNgxoPwwSwuawtPmX5vqaw1GpfxGsGlSZXdGJqb4RutLThs AZ+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rVfOGwc7N0VJCdVKF46G/HWJiscqeO0qIVu0S3Sqog8=; b=DBhduII8dENHfc50vSGdlgqGoeQRH0SuBZ+1nHk9oc4YXwTNtHAW1hpeiuRNIGaNX5 Wgd0FHUd3qH5OQ3jMkonuQ2I/h2/0SAadGjtmAh5iimb2MP9RGa5eXvkjK8xFlTwDA5o LykBrAL1GrEw84a47ErpzbXtBU4ZrK3X6RFRw6bnesu/ZZZDt4OBDFVv5UJDc4ZZXzzo 16A74AXsGSkT8VJqU1OXXmCRHRd3N2er6MuQtSZlQc+vICFA+Vlwn7WuwL2XopWFCwa7 Syzn/G/Js5jTrHYUr0IRZ+U/M3rSXEMkVfldQ/NHMvB9HsgRIF0r5YETmjqJhV1//pho qK/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="W7u1XW/Y"; 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 l9si1173381edc.339.2021.03.31.01.39.21; Wed, 31 Mar 2021 01:39:44 -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="W7u1XW/Y"; 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 S234476AbhCaIiQ (ORCPT + 99 others); Wed, 31 Mar 2021 04:38:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234460AbhCaIiH (ORCPT ); Wed, 31 Mar 2021 04:38:07 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A9F9C061574; Wed, 31 Mar 2021 01:38:07 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id k8so4544105pgf.4; Wed, 31 Mar 2021 01:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rVfOGwc7N0VJCdVKF46G/HWJiscqeO0qIVu0S3Sqog8=; b=W7u1XW/Y1n/3m5M9kyOUgiFLjtU1GP3707wLT8VU+B32QrPwc2TI7TbbloiDrIqj9K PTmrYPvRKY2lpyGGTRfba4DTFRFAPsIariAOAzjGZ/eFkJaoBij6fHDtekFukexA6Lxk nQQaxQ8LzUNBq0dWTxZJEpvfueau9Pc0XvrEeBdE1gM84m+++bsiN4m3zZCCj+E/EG1D HgbPcCePNZ+tOcUtCZHHfYGkCNojo5yQHT3GmoWDidPVkCS/FKL7hbbZEmIM6Aorv70E bjgBM/cIX+k4qTNV4TusEeJG53sdT5hKPeK0P0VOHqlgX2+CE5g4OOIQsRZtiPlKrR57 VDDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rVfOGwc7N0VJCdVKF46G/HWJiscqeO0qIVu0S3Sqog8=; b=HzIekjT8hm7nPNZEKaQW1zXB3XytmJ1qq7P0AZwHy562TP/sCFPvMUtIQK5AhiuHzv 1Xfkh6dEBTe+ZlOYs2UXbF2x1B4OwKpYt7ApAtUC1VyvSYtBYY2Y6XV6dTWVzsIpOtVD 6uigymCWMdbW4+TSXVlC5fCVNuh6QWvNlkFDxK6wNDQOfZPklT4bRdBs8cZ7fCpmzcL1 Gb3O4Z2wMBBO1zWHyQg+ehnN6Iw6GOajlRXJy8tGInj+HlF6mtlOhMhU7lMFROihyctz XF6wO58YYh9h9I6Uq2fP3GKhBjlWS3X0YEMwfqoesC6r+1kGz/oUPhrrRA+5YoaR+jD8 6byA== X-Gm-Message-State: AOAM533zhN7GsKgZNbG+7h9xG7oKWRmCDpuLL3swL4euYYqUMlkwLXXH OanyxV4j5yQ5Bdrk4lQhPv8= X-Received: by 2002:a63:c4f:: with SMTP id 15mr2179066pgm.379.1617179886832; Wed, 31 Mar 2021 01:38:06 -0700 (PDT) Received: from localhost ([47.8.37.177]) by smtp.gmail.com with ESMTPSA id j3sm1480659pfi.74.2021.03.31.01.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 01:38:06 -0700 (PDT) Date: Wed, 31 Mar 2021 14:08:00 +0530 From: Kumar Kartikeya Dwivedi To: Cong Wang Cc: Vlad Buslov , David Miller , Jamal Hadi Salim , Jiri Pirko , Jakub Kicinski , LKML , Linux Kernel Network Developers , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: [PATCH v2 1/1] net: sched: bump refcount for new action in ACT replace mode Message-ID: <20210331083800.b3b2ewfgxklo76ri@apollo> References: <20210329225322.143135-1-memxor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021 at 10:10:45AM IST, Cong Wang wrote: > 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()? > You are right, it wouldn't. I sent a new version with a fix. PTAL. > Thanks. -- Kartikeya