Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1481809imu; Tue, 11 Dec 2018 21:47:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/WGFtYtX95NcCxAMdhZitlsyIUyb8ZiEsdjBuU3imkrovL1JytmMeOdO5b1J4Rfu+l8Lb8w X-Received: by 2002:a17:902:e08b:: with SMTP id cb11mr18854894plb.263.1544593641382; Tue, 11 Dec 2018 21:47:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544593641; cv=none; d=google.com; s=arc-20160816; b=mzaV5Us9rKYBnzZ4MyGXGt3F8Ff1KoGhPh7B/5sh44dJBfLqxp+c1baiQPaVWK8DDb uK1MEu4HaarrPmhWQNZIL5SNhDAcFnqE+vagH796GPfWFapbYFkBP3Jm0sNqpHHxgodw 8PBLhMKcmgYKFGnUwU9BhsT/YHNuWITTXov8kkFEl2WKygzpYA3brWrQYWDG6PCeAXXV WUiyZyv8SHfCJD0TLrnVsb+HxYH4HU2OIkSwL866Q7E8W39UoI5eY5BrWnyiXKt72Y/N aTRt4mPhGxfmWr/iZfWcswxINBbZSoo4bGlWM4jc/5fmPQA/CH1BGaFF1bK1qrn6woL4 nG4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Rrd0BT4MynaVELlIxtzZ7SPkUGb/jfqqtjUqK1gibzM=; b=wcaev+uwN5kg+ZHvKDHFsAmHxb91gP37+rNdmGwNQnNwwiubJvHurOQD109BQTIrjD p4WfoQ8UYJESKwGp71IdI3o3nAZ6twVUBdmucD0YFos6Pq+H6Wnf4IMPJk1r9dnItcV2 2PI1ocd3o+LOk3oobmwtOyfLE2iUDFH3SB1rV9EO8faVc1gYYFDnkgxjtqJIT5KsSGH+ K6y40/EMXbI97Zdowwb3iWtqM1m28tsWa//3PewZG3WagC0B6hOsI0qnHqYInNWIGfEa yfuynV5dcmHICqiM5jI2PqYnQENFeWs8B0V4X4Ve6hX1FEs5xA/FpK3Ncgb3gkuzwgok 3h5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si13522372pgh.185.2018.12.11.21.47.06; Tue, 11 Dec 2018 21:47:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbeLLFqP (ORCPT + 99 others); Wed, 12 Dec 2018 00:46:15 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:47006 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbeLLFqP (ORCPT ); Wed, 12 Dec 2018 00:46:15 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1gWxLU-000367-90; Wed, 12 Dec 2018 13:46:08 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gWxLN-0002El-LR; Wed, 12 Dec 2018 13:46:01 +0800 Date: Wed, 12 Dec 2018 13:46:01 +0800 From: Herbert Xu To: NeilBrown Cc: Thomas Graf , Tom Herbert , David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] rhashtable: further improve stability of rhashtable_walk Message-ID: <20181212054601.wbzpxjunnsfi62mz@gondor.apana.org.au> References: <153086101070.2825.6850140624411927465.stgit@noble> <153086109256.2825.15329014177598382684.stgit@noble> <87zhtkeimx.fsf@notabene.neil.brown.name> <20181207053943.7zacyn5uvqkfnfoi@gondor.apana.org.au> <87k1kico1o.fsf@notabene.neil.brown.name> <20181211051755.modgomqzszkbiihe@gondor.apana.org.au> <87mupbvch0.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mupbvch0.fsf@notabene.neil.brown.name> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 12, 2018 at 11:02:35AM +1100, NeilBrown wrote: > > So I think this is a real bug - it is quite unlikely to hit, but > possibly. > You need a chain with at least 2 objects, you need > rhashtable_walk_stop() to be called after visiting an object other than > the last object, and you need some thread (this or some other) to remove > that object from the table. > > The patch that I posted aims to fix that bug, and only that bug. > The only alternative that I can think of is to document that this can > happen and advise that a reference should be held to the last visited > object when stop/start is called, or in some other way ensure that it > doesn't get removed. Thanks for reminding me of the issue you were trying to fix. So going back into the email archives, I suggested at the very start that we could just insert the walker objects into the actual hash table. That would solve the issue for both rhashtable and rhlist. Could we do that rather than using this ordered list that only works for rhashtable? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt