• Alex Chiang's avatar
    sysfs: sysfs_add_one WARNs with full path to duplicate filename · 425cb029
    Alex Chiang authored
    sysfs: sysfs_add_one WARNs with full path to duplicate filename
    
    As a debugging aid, it can be useful to know the full path to a
    duplicate file being created in sysfs.
    
    We now will display warnings such as:
    
    	sysfs: cannot create duplicate filename '/foo'
    
    when attempting to create multiple files named 'foo' in the sysfs
    root, or:
    
    	sysfs: cannot create duplicate filename '/bus/pci/slots/5/foo'
    
    when attempting to create multiple files named 'foo' under a
    given directory in sysfs.
    
    The path displayed is always a relative path to sysfs_root. The
    leading '/' in the path name refers to the sysfs_root mount
    point, and should not be confused with the "real" '/'.
    
    Thanks to Alex Williamson for essentially writing sysfs_pathname.
    
    Cc: Alex Williamson <alex.williamson@hp.com>
    Signed-off-by: default avatarAlex Chiang <achiang@hp.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    425cb029
dir.c 23 KB