lkml.org 
[lkml]   [2012]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] vfs: dcache: fix deadlock in tree traversal
Date
Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Tue, Sep 18, 2012 at 7:53 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>>
>> Yes, with the test cases that IBM were using it is DCACHE_DISCONNECTED
>> case that triggers the double-lock. Trond was misusing
>> DCACHE_DISCONNECTED and this made the failure in try_to_ascend() much
>> more likely (and bogus). But there is a case, which is triggered rarely
>> if ever, when try_to_ascend() failure with rename_lock held is perfectly
>> valid.
>
> Ok. The whole DCACHE_DISCONNECTED logic there is clearly bogus and
> results in endless loops if that case then ever triggers, but you fix
> that in the second patch.
>
> HOWEVER. Why introduce that new DCACHE_KILLED flag at all? Wouldn't it
> be much better to just check whether the dentry is hashed instead of
> introducing a new flag for this case? Couldn't we just check for
> "d_unhashed()"?

Not good, because an unhashed dentry can stay around and that would mean
that we'd need to restart the walk until the last ref to the dentry is
dropped (which can be an arbitrary long time).

Look at commit c83ce989. Before that patch try_to_ascend() was using
old->d_parent != NULL (implicit in the "new != old->d_parent" test) to
test for the dentry being killed. I think we need to keep that logic,
and using a dentry flag for that looks simple enough.

Thanks,
Miklos


\
 
 \ /
  Last update: 2012-09-18 19:01    [W:0.046 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site