From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933102AbbIVIUF (ORCPT ); Tue, 22 Sep 2015 04:20:05 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:35113 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753826AbbIVIUB (ORCPT ); Tue, 22 Sep 2015 04:20:01 -0400 Date: Tue, 22 Sep 2015 10:19:58 +0200 From: Thomas Graf To: Eric Dumazet Cc: Dmitry Vyukov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kcc@google.com, andreyknvl@google.com, glider@google.com, ktsan@googlegroups.com, paulmck@linux.vnet.ibm.com Subject: Re: [PATCH] lib: fix data race in rhashtable_rehash_one Message-ID: <20150922081958.GC13047@pox.localdomain> References: <1442822930-35319-1-git-send-email-dvyukov@google.com> <1442842315.29850.44.camel@edumazet-glaptop2.roam.corp.google.com> <1442847108.29850.56.camel@edumazet-glaptop2.roam.corp.google.com> <20150921222538.GA31246@pox.localdomain> <1442876618.29850.64.camel@edumazet-glaptop2.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442876618.29850.64.camel@edumazet-glaptop2.roam.corp.google.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/21/15 at 04:03pm, Eric Dumazet wrote: > What I said is : > > In @head you already have the correct nulls value, from hash table. > > You do not need to recompute this value, and/or test if hash table chain > is empty. > > If hash bucket is empty, it contains the appropriate NULLS value. > > If you are paranoiac add this debugging check : > > if (rht_is_a_nulls(head)) > BUG_ON(head != (struct rhash_head *)rht_marker(ht, new_hash)); > > > Therefore, simply fix the bug and unnecessary code with : You are absolutely right Eric. Do you want to revise your patch Dmitry? Eric's proposed fix absolutely the best way to fix this.