Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[pandora-kernel.git] / fs / sysfs / inode.c
index a4a0a94..bbd77e9 100644 (file)
@@ -324,7 +324,7 @@ void sysfs_delete_inode(struct inode *inode)
        sysfs_put(sd);
 }
 
-int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name)
+int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const void *ns, const char *name)
 {
        struct sysfs_addrm_cxt acxt;
        struct sysfs_dirent *sd;
@@ -334,7 +334,9 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name)
 
        sysfs_addrm_start(&acxt, dir_sd);
 
-       sd = sysfs_find_dirent(dir_sd, name);
+       sd = sysfs_find_dirent(dir_sd, ns, name);
+       if (sd && (sd->s_ns != ns))
+               sd = NULL;
        if (sd)
                sysfs_remove_one(&acxt, sd);