From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755209AbcGENv4 (ORCPT ); Tue, 5 Jul 2016 09:51:56 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:38344 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755167AbcGENvv (ORCPT ); Tue, 5 Jul 2016 09:51:51 -0400 Date: Tue, 5 Jul 2016 14:51:49 +0100 From: Al Viro To: Oleg Drokin Cc: Mailing List , "" Subject: Re: More parallel atomic_open/d_splice_alias fun with NFS and possibly more FSes. Message-ID: <20160705135149.GM14480@ZenIV.linux.org.uk> References: <20160617042914.GD14480@ZenIV.linux.org.uk> <20160703062917.GG14480@ZenIV.linux.org.uk> <94F1587A-7AFC-4B48-A0FC-F4CE152F18CC@linuxhacker.ru> <20160705123110.GL14480@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160705123110.GL14480@ZenIV.linux.org.uk> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 05, 2016 at 01:31:10PM +0100, Al Viro wrote: > On Tue, Jul 05, 2016 at 02:22:48AM -0400, Oleg Drokin wrote: > > > > + if (!(open_flags & O_CREAT) && !d_unhashed(dentry)) { > > s/d_unhashed/d_in_lookup/ in that. > > > So we come racing here from multiple threads (say 3 or more - we have seen this > > in the older crash reports, so totally possible) > > > > > + d_drop(dentry); > > > > One lucky one does this first before the others perform the !d_unhashed check above. > > This makes the other ones to not enter here. > > > > And we are back to the original problem of multiple threads trying to instantiate > > same dentry as before. > > Yep. See above - it should've been using d_in_lookup() in the first place, > through the entire nfs_atomic_open(). Same in the Lustre part of fixes, > obviously. See current #for-linus for hopefully fixed variants (both lustre and nfs)