diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-09-13 05:53:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:51:09 -0400 |
commit | 5c3e8964ce87477a12e3e9edc3742156a3929a74 (patch) | |
tree | fa9f43c11b7eea40d8758a638b8452ae5a1e724f /fs/sysfs/dir.c | |
parent | dc8c85871c9728c5fddca6854a191fd41eb9438c (diff) |
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 <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/dir.c')
-rw-r--r-- | 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 da4bb66a610c..5d95aa8e23c6 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -428,8 +428,12 @@ void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt, | |||
428 | */ | 428 | */ |
429 | int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd) | 429 | int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd) |
430 | { | 430 | { |
431 | if (sysfs_find_dirent(acxt->parent_sd, sd->s_name)) | 431 | if (sysfs_find_dirent(acxt->parent_sd, sd->s_name)) { |
432 | printk(KERN_WARNING "sysfs: duplicate filename '%s' " | ||
433 | "can not be created\n", sd->s_name); | ||
434 | WARN_ON(1); | ||
432 | return -EEXIST; | 435 | return -EEXIST; |
436 | } | ||
433 | 437 | ||
434 | sd->s_parent = sysfs_get(acxt->parent_sd); | 438 | sd->s_parent = sysfs_get(acxt->parent_sd); |
435 | 439 | ||