Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sysfs: Update the name hash when renaming sysfs entries

This fixes a bug introduced with sysfs name hashes where renaming a
network device appears to succeed but silently makes the sysfs files for
that network device inaccessible.

In at least one configuration this bug has stopped networking from
coming up during boot.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Tested-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Eric W. Biederman and committed by
Greg Kroah-Hartman
d5c38b13 07d25146

+1
+1
fs/sysfs/dir.c
··· 872 872 873 873 dup_name = sd->s_name; 874 874 sd->s_name = new_name; 875 + sd->s_hash = sysfs_name_hash(sd->s_ns, sd->s_name); 875 876 } 876 877 877 878 /* Move to the appropriate place in the appropriate directories rbtree. */