From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33636 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750815AbeDFII5 (ORCPT ); Fri, 6 Apr 2018 04:08:57 -0400 From: David Howells In-Reply-To: <20180406065118.GZ30522@ZenIV.linux.org.uk> References: <20180406065118.GZ30522@ZenIV.linux.org.uk> <152296016916.31027.8912809030401942390.stgit@warthog.procyon.org.uk> <152296020457.31027.11109314533967989357.stgit@warthog.procyon.org.uk> To: Al Viro Cc: dhowells@redhat.com, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/20] afs: Implement @sys substitution handling MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22232.1523002135.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Fri, 06 Apr 2018 09:08:55 +0100 Message-ID: <22233.1523002135@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Al Viro wrote: > > +static struct dentry *afs_lookup_atsys(struct inode *dir, struct dentry *dentry, > > + struct key *key) > > +{ > > > + ret = lookup_one_len(buf, parent, len); > > Er... Parent is locked only shared here and lookup_one_len() seriously > depends upon exclusive lock. As it is, race with lookup of the full name > will mess the things up very badly. How should it be done? Do I have to use d_alloc_parallel(), analogous to lookup_slow() without taking the rwsem again? David PS: Can you stick a banner comment on d_alloc_parallel() describing it?