From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 10/13] VFS/namei: handle LOOKUP_RCU in page_follow_link_light. Date: Thu, 19 Mar 2015 23:46:28 +0000 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 Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: NeilBrown Return-path: Content-Disposition: inline In-Reply-To: <20150320093833.25603da2@notabene.brown> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.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.