]> git.hungrycats.org Git - linux/commit
[PATCH] Set d_bucket correctly for anonymous dentries
authorAndrew Morton <akpm@osdl.org>
Thu, 27 May 2004 00:35:31 +0000 (17:35 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 27 May 2004 00:35:31 +0000 (17:35 -0700)
commit59a6ce4f0086b52a5e7e8db2c8ed8027e11770e1
tree9322e6a521b2631d724a9c69d8db0c9532580ffb
parentab31c400a21269345c285a3fa451227653717feb
[PATCH] Set d_bucket correctly for anonymous dentries

From: Neil Brown <neilb@cse.unsw.edu.au>

In researching the oopses reported in bug #2761, Neil came up with:

I have found one problem, but it isn't particularly new and I cannot
 see how it would be related.

When d_alloc_anon creates an anonymous dentry, it is put on a special hash
chain for anonymous dentries (sb->s_anon), but d_bucket is set to

   d_hash(parent, name_hash)

If, when it is eventually moved to a proper name, that hash value is the same
as the final hash value, it will not be moved to the right bucket, and so it
not be accessible by name.  This patch should fix it.

anonymous dentries have their own private hash "bucket" (sb->s_anon) and so
d_bucket should be set to a unique (impossible) address, else d_move will
get confused.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
fs/dcache.c