diff options
author | Vasily Averin <vvs@sw.ru> | 2006-12-06 23:37:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:35 -0500 |
commit | dc168427e6250a5a24c59f34afed6538092dab42 (patch) | |
tree | 647cfff74c45ec42027042666d5212b1c724a350 /fs/namei.c | |
parent | 5ac29e62be2a581ec77953eca64d85ddeef488f0 (diff) |
[PATCH] VFS: extra check inside dentry_unhash()
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>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index 61f99c1967d9..db1bca26d88c 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1998,8 +1998,7 @@ asmlinkage long sys_mkdir(const char __user *pathname, int mode) | |||
1998 | void dentry_unhash(struct dentry *dentry) | 1998 | void dentry_unhash(struct dentry *dentry) |
1999 | { | 1999 | { |
2000 | dget(dentry); | 2000 | dget(dentry); |
2001 | if (atomic_read(&dentry->d_count)) | 2001 | shrink_dcache_parent(dentry); |
2002 | shrink_dcache_parent(dentry); | ||
2003 | spin_lock(&dcache_lock); | 2002 | spin_lock(&dcache_lock); |
2004 | spin_lock(&dentry->d_lock); | 2003 | spin_lock(&dentry->d_lock); |
2005 | if (atomic_read(&dentry->d_count) == 2) | 2004 | if (atomic_read(&dentry->d_count) == 2) |