namecache: locks and races

Richard Nyberg rnyberg at it.su.se
Thu Feb 10 23:34:47 PST 2005


At Thu, 10 Feb 2005 11:02:09 -0800 (PST),
Matthew Dillon wrote:
>     Ahhh.  This clears things up!   Very nice debugging printfs.   It makes
>     it completely obvious.
> 
>     What is happening is that cache_resolve() is creating a child node 
>     under home at the same time cache_inval() is trying to invalidate it.
> 
>     Hmm.  Ok.  I think I might have been a bit overzelous in the retry code. 
>     It isn't actually necessary to re-destroy new associations created
>     while cache_inval is recursing on the children.  We only need to destroy
>     the *old* associations.  This means we can take just a single-pass
>     through and get rid of the retry code entirely.
>
>     The only place where it really matters is in cache_rename(), but that
>     case can be handled in cache_rename() itself.

Actually, I was thinking that the retry may be unnecessary when I first
looked at cache_inval. I wasn't really sure about what all callers expected
though.

>     I really appreciate the work you are doing, the new namecache code is
>     the cornerstone of a great deal of already completed and up-and-coming
>     VFS code and we have to make sure it works properly.
> 
>     Please try this patch.
> 
Works great.

Thanks!
        -Richard






More information about the Kernel mailing list