Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5c3e8964ce87477a12e3e9edc3742156a3929a74
Commit:     5c3e8964ce87477a12e3e9edc3742156a3929a74
Parent:     dc8c85871c9728c5fddca6854a191fd41eb9438c
Author:     Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Thu Sep 13 02:53:13 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:51:09 2007 -0700

    sysfs: spit a warning to users when they try to create a duplicate sysfs 
file
    
    We want to let people know when we create a duplicate sysfs file, as
    they need to fix up their code.
    
    
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index da4bb66..5d95aa8 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -428,8 +428,12 @@ void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
  */
 int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
 {
-       if (sysfs_find_dirent(acxt->parent_sd, sd->s_name))
+       if (sysfs_find_dirent(acxt->parent_sd, sd->s_name)) {
+               printk(KERN_WARNING "sysfs: duplicate filename '%s' "
+                      "can not be created\n", sd->s_name);
+               WARN_ON(1);
                return -EEXIST;
+       }
 
        sd->s_parent = sysfs_get(acxt->parent_sd);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to