From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbbCSXqc (ORCPT ); Thu, 19 Mar 2015 19:46:32 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:56062 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751127AbbCSXqb (ORCPT ); Thu, 19 Mar 2015 19:46:31 -0400 Date: Thu, 19 Mar 2015 23:46:28 +0000 From: Al Viro To: NeilBrown Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/13] VFS/namei: handle LOOKUP_RCU in page_follow_link_light. Message-ID: <20150319234625.GT29656@ZenIV.linux.org.uk> References: <20150316043602.23648.52734.stgit@notabene.brown> <20150316044320.23648.90827.stgit@notabene.brown> <20150316225040.GG29656@ZenIV.linux.org.uk> <20150320093833.25603da2@notabene.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150320093833.25603da2@notabene.brown> 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 Fri, Mar 20, 2015 at 09:38:33AM +1100, NeilBrown wrote: > Ahhh - that's what nd->inode is for. I wondered. > > Am I correct in thinking that dentry->d_inode can only become NULL - it cannot > then become some other inode? It can - consider somebody doing mkdir on that name right under you. _All_ we are guaranteed is that at some moment nd->inode matched the pathname this far and so was (at the same moment) path->dentry. We are not promised that these inode and dentry will remain associated with each other, etc. We ought to check ->d_seq after checking ->d_flags, BTW. _That_ will confirm that inode remained corresponding to that dentry until the time we'd observed d_is_symlink(dentry), i.e. make sure that inode *is* a symlink one. And yes, we probably would have to pass dentry and inode separately, more's the pity.