[lkml]   [2009]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] sysfs: sysfs_add_one tells you _where_ the duplicate file is
    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 <>
    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;

     \ /
      Last update: 2009-02-11 21:29    [W:2.411 / U:7.564 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site