From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757910AbaKTSFT (ORCPT ); Thu, 20 Nov 2014 13:05:19 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:59295 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757841AbaKTSFR (ORCPT ); Thu, 20 Nov 2014 13:05:17 -0500 Date: Thu, 20 Nov 2014 18:05:03 +0000 From: Al Viro To: Andrey Konovalov 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 Subject: Re: Potential data race in dput and __d_lookup Message-ID: <20141120180503.GN7996@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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.