[PATCH] sysfs: sysfs_add_one tells you _where_ the duplicate fileis

From: Alex Chiang
Date: Wed Feb 11 2009 - 15:26:21 EST


Give a better clue about where we might be creating duplicate
files by displaying the parent's name as well.

Signed-off-by: Alex Chiang <achiang@xxxxxx>
---
It would be nice to get a full path, but simply printing out the
parent is cheap and more useful than what we have now.

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 82d3b79..5828d1d 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -459,7 +459,8 @@ int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)

ret = __sysfs_add_one(acxt, sd);
WARN(ret == -EEXIST, KERN_WARNING "sysfs: duplicate filename '%s' "
- "can not be created\n", sd->s_name);
+ "can not be created in %s\n",
+ sd->s_name, acxt->parent_sd->s_name);
return ret;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/