• Eric W. Biederman's avatar
    sysfs: Introduce sysfs_rename_mutex · 932ea2e3
    Eric W. Biederman authored
    Looking carefully at the rename code we have a subtle dependency
    that the structure of sysfs not change while we are performing
    a rename.  If the parent directory of the object we are renaming
    changes while the rename is being performed nasty things could
    happen when we go to release our locks.
    
    So introduce a sysfs_rename_mutex to prevent this highly
    unlikely theoretical issue.
    
    In addition hold sysfs_rename_mutex over all calls to
    sysfs_get_dentry. Allowing sysfs_get_dentry to be simplified
    in the future.
    Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    932ea2e3
sysfs.h 3.56 KB