Re: Msdos name alias patch for 2.1.48

Bill Hawes (whawes@star.net)
Thu, 07 Aug 1997 10:48:23 -0400


Linus Torvalds wrote:

> /* So what happens in fs/inode.c: lookup() is: */
>
> 'reserved_lookup()' ('.' and '..') obviously fails
> 'dcache_lookup()' fails
> 'real_lookup()'
> - creates a new dentry for 'XyZZy'
> - calls the low-level lookup
> - low-level lookup finds the 'XyZZy' inode
> but notices that it already has a dentry
> by looking at the 'inode->i_dentry' list
> - low-level lookup throws away new 'XyZZy'
> dentry, and instead returns the old
> 'xyzzy' dentry
>
> How does this strike people? The above means that we only ever have one
> dentry for a filename even when you have alias names, and it requires
> almost no changes to the generic VFS layer (it requires a way for the
> low-level lookup to change the dentry, but that should be reasonably
> simple).

Sounds reasonable, but be careful in implementing it: if the fs lookup
dputs the dentry currently passed, you'll corrupt the dentry tree. The
d_alloc()ed dentry has its parent pointer set, but hasn't incremented
the parent d_count.

Regards,
Bill