Skip to content

Commit

Permalink
[PATCH] VFS: extra check inside dentry_unhash()
Browse files Browse the repository at this point in the history
d_count check after dget() is always true.

Signed-off-by:	Vasily Averin <vvs@sw.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Vasily Averin authored and Linus Torvalds committed Dec 7, 2006
1 parent 5ac29e6 commit dc16842
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,8 +1998,7 @@ asmlinkage long sys_mkdir(const char __user *pathname, int mode)
void dentry_unhash(struct dentry *dentry)
{
dget(dentry);
if (atomic_read(&dentry->d_count))
shrink_dcache_parent(dentry);
shrink_dcache_parent(dentry);
spin_lock(&dcache_lock);
spin_lock(&dentry->d_lock);
if (atomic_read(&dentry->d_count) == 2)
Expand Down

0 comments on commit dc16842

Please sign in to comment.