From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754885AbaHAPAK (ORCPT ); Fri, 1 Aug 2014 11:00:10 -0400 Received: from stinky.trash.net ([213.144.137.162]:55759 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754547AbaHAPAI (ORCPT ); Fri, 1 Aug 2014 11:00:08 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <20140801145145.GE7331@casper.infradead.org> References: <53DB864B.2070205@redhat.com> <20140801134901.GD7331@casper.infradead.org> <0d77fb6a-4465-432f-9d6a-b1c1497a780b@email.android.com> <20140801145145.GE7331@casper.infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH net-next 3/3] nftables: Convert nft_hash to use generic rhashtable From: Patrick McHardy Date: Fri, 01 Aug 2014 16:00:00 +0100 To: Thomas Graf CC: Nikolay Aleksandrov , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, challa@noironetworks.com, walpole@cs.pdx.edu, dev@openvswitch.org, tklauser@distanz.ch, netfilter-devel@vger.kernel.org, pablo@netfilter.org Message-ID: <68a32a9d-9421-4fdd-91db-8106eaa0897a@email.android.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1. August 2014 15:51:45 GMT+01:00, Thomas Graf wrote: >On 08/01/14 at 03:12pm, Patrick McHardy wrote: >> On 1. August 2014 14:49:01 GMT+01:00, Thomas Graf >wrote: >> >On 08/01/14 at 02:21pm, Nikolay Aleksandrov wrote: >> >> Sorry for the late response but I just got around to check the 3rd >> >patch now, >> >> so my question about this fragment is: before nft_hash_remove() >would >> >free the >> >> element after removal, but after this change I don't see where and >> >when the >> >> removed element would get freed ? >> > >> >You are right. Looking at this closer we were leaking references >even >> >before the change because it would not call nft_data_uninit() to >> >release >> >the data objects. So it should really just call >> >nft_hash_elem_destroy(). >> >> No, the data uninit is performed by the set core. Just freeing it is >fine. > >OK, I can see the uninit on the data in nft_del_setelem() for maps >prior to the actual commit. The location is slightly unexpected since >the element is still findable in the hash table at that point. That's most likely a bug from the transaction API. Pablo? >I'll wait a short while to see if there is more feedback and resubmit >afterwards.