Skip to content

Commit

Permalink
sysfs: Update the name hash when renaming sysfs entries
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Jiri Slaby <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ebiederm authored and gregkh committed Jan 31, 2012
1 parent 07d2514 commit d5c38b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit d5c38b1

Please sign in to comment.