Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5c38b13 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Greg Kroah-Hartman
Browse files

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: default avatarEric W. Biederman <ebiederm@xmission.com>
Tested-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 07d25146
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -872,6 +872,7 @@ int sysfs_rename(struct sysfs_dirent *sd,

		dup_name = sd->s_name;
		sd->s_name = new_name;
		sd->s_hash = sysfs_name_hash(sd->s_ns, sd->s_name);
	}

	/* Move to the appropriate place in the appropriate directories rbtree. */