From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752484AbdGGOQv (ORCPT ); Fri, 7 Jul 2017 10:16:51 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:54748 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbdGGOQt (ORCPT ); Fri, 7 Jul 2017 10:16:49 -0400 Date: Fri, 7 Jul 2017 15:16:48 +0100 From: Al Viro To: Gioh Kim Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] guarantee inode of alias's parent Message-ID: <20170707141647.GD10672@ZenIV.linux.org.uk> References: <20170707132811.18832-1-gi-oh.kim@profitbricks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170707132811.18832-1-gi-oh.kim@profitbricks.com> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 07, 2017 at 03:28:11PM +0200, Gioh Kim wrote: > Before __d_unalias(), the dentry and parent of the dentry > are locked. But I wonder how I can assure of existence of the > alias and the parent of the alias. > > Where is the code to lock alias and alias->d_parent? Nowhere. Why the hell would you want to lock them? > What will happend if alias->d_parent be deleted by another process? Huh? As soon as you've grabbed ->s_vfs_rename_mutex, ->d_parent of everything on that filesystem is stable - and positive. Moreover, any positive dentry with references held (in particular, anyone's parent) is going to remain such for as long as those references are held.