Jeremy Fitzhardinge wrote:
> 
> I'm thinking it might all be a lot simpler if dentries are never
> invalidated.  The -ve ones could be reclaimed by the normal machinery,
> but revalidate need never return 0.  That way a given name in active use
> would only ever have a single dentry associated with it, which makes the
> bookkeeping much simpler.
> 

Now how do you deal with the following case:

Process 1 does a lookup on /foo/bar, triggers daemon response
The daemon mkdirs /foo/bar
Process 2 accesses /foo/bar (no lookup happens, because the dentry
exists)
The daemon fails to mount /foo/bar, does an rmdir()
The kernel releases process 1 and 2.

Process 1 is still OK, because it's in lookup, which can fail normally. 
Process 2 is not so lucky.

In autofs v3 this was buggy for a *long* time after dentries were
introduced: process 2 would end up in a phantom empty directory which
didn't really exist.

        -hpa

Reply via email to