
From: Maneesh Soni <maneesh@in.ibm.com>

Do not release existing directory if the new directory happens to be a
duplicate directory.  Thanks to Kay Sievers for the testcase.

Signed-off-by: <maneesh@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/sysfs/dir.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/sysfs/dir.c~sysfs-fix-dropping-existing-dir fs/sysfs/dir.c
--- 25/fs/sysfs/dir.c~sysfs-fix-dropping-existing-dir	Wed Nov 10 16:21:47 2004
+++ 25-akpm/fs/sysfs/dir.c	Wed Nov 10 16:21:47 2004
@@ -111,7 +111,7 @@ static int create_dir(struct kobject * k
 				d_rehash(*d);
 			}
 		}
-		if (error)
+		if (error && (error != -EEXIST))
 			d_drop(*d);
 		dput(*d);
 	} else
_
