Re: [PATCH 10/13] VFS/namei: handle LOOKUP_RCU in page_follow_link_light.

From: Al Viro
Date: Thu Mar 19 2015 - 19:46:36 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/