From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80B4FC35240 for ; Fri, 31 Jan 2020 22:09:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5FC082082E for ; Fri, 31 Jan 2020 22:09:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726216AbgAaWJT (ORCPT ); Fri, 31 Jan 2020 17:09:19 -0500 Received: from Chamillionaire.breakpoint.cc ([193.142.43.52]:52810 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgAaWJT (ORCPT ); Fri, 31 Jan 2020 17:09:19 -0500 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1ixeTV-00065Y-Bi; Fri, 31 Jan 2020 23:09:17 +0100 Date: Fri, 31 Jan 2020 23:09:17 +0100 From: Florian Westphal To: Cong Wang Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, syzbot+adf6c6c2be1c3a718121@syzkaller.appspotmail.com, Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal Subject: Re: [Patch nf 2/3] xt_hashlimit: reduce hashlimit_mutex scope for htable_put() Message-ID: <20200131220917.GL795@breakpoint.cc> References: <20200131205216.22213-1-xiyou.wangcong@gmail.com> <20200131205216.22213-3-xiyou.wangcong@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200131205216.22213-3-xiyou.wangcong@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Cong Wang wrote: > It is unnecessary to hold hashlimit_mutex for htable_destroy() > as it is already removed from the global hashtable and its > refcount is already zero. > > Also, switch hinfo->use to refcount_t so that we don't have > to hold the mutex until it reaches zero in htable_put(). LGTM, thanks! Acked-by: Florian Westphal