lkml.org 
[lkml]   [2003]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] First casuality of hlist poisoning in 2.5.70
From
>>>>> " " == Linus Torvalds <torvalds@transmeta.com> writes:

>> - hlist_del_rcu(&dentry->d_hash);
>> - hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
>> + if (!hlist_unhashed(&dentry->d_hash))
>> + hlist_del_rcu(&dentry->d_hash);
>> + if (!hlist_unhashed(&target->d_hash)) {
>> + hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
>> + dentry->d_vfs_flags &= ~DCACHE_UNHASHED;
>> + } else
>> + dentry->d_vfs_flags |= DCACHE_UNHASHED;

> Can source or target really be validly unhashed? That makes no
> sense, since we just looked it up, and we've held the directory
> semaphores over the whole thing.

When renaming, we may want to unhash the dentry in order to stop
d_lookup()s from succeeding (Recall that cached_lookup() does not
attempt to take the directory semaphore - only real_lookup() does
that).

AFAICS one should not rehash the dentry until after the d_move(). Does
that make sense?

Cheers,
Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.258 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site