From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: Potential data race in dput and __d_lookup Date: Thu, 20 Nov 2014 18:05:03 +0000 Message-ID: <20141120180503.GN7996@ZenIV.linux.org.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Ingo Molnar , Will Deacon , Peter Zijlstra , Davidlohr Bueso , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Vyukov , Kostya Serebryany , ktsan@googlegroups.com To: Andrey Konovalov Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Nov 20, 2014 at 09:20:14PM +0400, Andrey Konovalov wrote: > It seems that one thread increments 'dentry->d_lockref.count', while > other does 'lockref_put_or_lock(&dentry->d_lockref)' without any > synchronization. > > Could you confirm if this is a real race? I can not. Increment in __d_lookup() is under ->d_lockref.lock (aka ->d_lock) and lockref_put_or_lock() is atomic wrt that.