From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [Patch net-next] act_mirred: get rid of mirred_list_lock spinlock Date: Thu, 30 Nov 2017 17:02:38 -0800 Message-ID: References: <20171130225335.6957-1-xiyou.wangcong@gmail.com> <20171130225335.6957-2-xiyou.wangcong@gmail.com> <1512083524.19682.29.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Linux Kernel Network Developers , Jiri Pirko , Jamal Hadi Salim To: Eric Dumazet Return-path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:34193 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751817AbdLABC7 (ORCPT ); Thu, 30 Nov 2017 20:02:59 -0500 Received: by mail-pg0-f66.google.com with SMTP id j4so3771404pgp.1 for ; Thu, 30 Nov 2017 17:02:59 -0800 (PST) In-Reply-To: <1512083524.19682.29.camel@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Nov 30, 2017 at 3:12 PM, Eric Dumazet wrote: > On Thu, 2017-11-30 at 14:53 -0800, Cong Wang wrote: >> @@ -55,13 +54,10 @@ static void tcf_mirred_release(struct tc_action >> *a, int bind) >> struct tcf_mirred *m = to_mirred(a); >> struct net_device *dev; >> >> - /* We could be called either in a RCU callback or with RTNL >> lock held. */ >> - spin_lock_bh(&mirred_list_lock); >> list_del(&m->tcfm_list); >> dev = rcu_dereference_protected(m->tcfm_dev, 1); > > If RTNL is held at this point, I suggest to use > rtnl_dereference() instead of rcu_dereference_protected() to get proper > lockdep coverage. Ah, sure, I missed it. Will send v2 later.