This would work, and I actually implemented it at first. However, it
still runs into problems. I set d_revalidate for all aliases so they
get looked up using real_lookup everytime. However, the dentry using
the alias still exists, so if I do
1# touch LongFileName
2# rm longfi~1
3# ls -l LongFileName
3 succeeds when it should fail. This is because the LongFileName
entry does not need to be revalidated. Of course, I could set everything
to revalidate, and then I'd be back to having no dcache at all (worse
than 2.0.x). Setting everything to revalidate would give the correct
results.
> Maybe you can extend the d_compare operation instead. When searching a
> name, the dcache will first compare the name to each existing dentry.
> So when searching a short name, it would search for the long name.
> vfat_cmp would not only check for dots in the back, but also check
> whether the short name is an alias for the long name, in which case
> vfat_cmp would succeed.
>
> The dcache will then conclude that it found the right dentry, and not
> try to create another one. In order to make this work, you will also
> have to instantiate the long name when asked for the short one.
This seems like the best suggestion, and I've done some work to try to
implement it. I need to extend both d_hash and d_compare because d_compare
will not get called unless the hash value is the same. I'll see if any
additional problems arise.
- Gordon