I agree that the target dentry can't be freed, but the old parent may
have been released by the dput(). And since alloc_new_name may block,
the stale parent pointer may get used for the same reason parent
pointers ever get used -- an object linked to the target might want to
get a pathname, for instance.
> I guess I should rewrite d_move() to be more robust: there really isn't
> any reason for the stale parent pointer in the first place. (And while I
> don't think this is a bug, I certainly agree that it is very ugly).
I would like to see the new name allocation removed -- the new name
should be allocated by the client, so that the potential error can be
reported. Then if the new name is passed in as a reference to a dentry,
d_move can just steal the new name and swap the old name.
Regards,
Bill