Re: [PATCH] First casuality of hlist poisoning in 2.5.70

Date: Thu Jun 12 2003 - 11:26:27 EST

On Wed, Jun 11, 2003 at 10:22:25PM -0700, Linus Torvalds wrote:

> HOWEVER, I actually suspect that the target really _cannot_ be unhashed,
> and that the test makes no sense, and the sequence should just be
> /* Rehash the dentry onto the same hash as the target */
> hlist_del_rcu(&dentry->d_hash);
> hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
> dentry->d_vfs_flags &= ~DCACHE_UNHASHED;
> But I suspect that neither dentry nor target should really ever be
> unhashed by the time we call d_move(). That's reinforced by the fact that
> it looks like a unhashed dentry in d_move() would have been a silent bug
> previously - staying unhashed if it just shared the bucket.

> Al, I'll be really happy having you go over this code too. And whatever we
> decide is right (enforcing hashedness or whatever), we should assert it,
> because clearly d_move() has been a bit too subtle for us so far.

Sigh... The real problem is not in d_move(), but in the way NFS drops
dentries. That, and the fact that we are eating the consequences of
RCU use in dcache - it had predictably made the entire thing _far_ too

We probably should accept that both d_move() arguments can be unhashed.
After the move hashed status of source should remain as it is and
victim^Wtarget should get unhashed.

We _do_ need to sort out the situation with unhashing stuff in NFS - in
particular, the way it deals with mountpoints and with directories is
a mess. I'm looking through that code, but it's bloody slow analysis
due to RCU. Premature optimizations and all such...
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Jun 15 2003 - 22:00:32 EST