sysfs: Update the name hash for an entry after changing the namespace
PATCH 1/1 sysfs: Update the name hash for an entry after changing the namespace
This is needed to allow renaming network devices that have been moved to another network namespace.
--- fs/sysfs/dir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/sysfs/dir.c +1 -1
@@ -878,7 +878,6 @@ 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. */
@@ -886,6 +885,7 @@ int sysfs_rename(struct sysfs_dirent *sd,sysfs_get (new_parent_sd);sysfs_put (sd->s_parent); sd->s_ns = new_ns; + sd->s_hash =sysfs_name_hash (sd->s_ns, sd->s_name); sd->s_parent = new_parent_sd;sysfs_link_sibling (sd);
Signature · 1 line
1.7.5.4
Greg Kroah-Hartman
maintainerQuoted 7 lines · Tom Goff
This is needed to allow renaming network devices that have been moved to another network namespace.
Signed-off-by Tom Goff <[email protected]>--- fs/sysfs/dir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Is this a bug in 3.4-rc1 and older kernels? If so, how old?
thanks,
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
Quoted 7 lines · Tom Goff
This is needed to allow renaming network devices that have been moved to another network namespace.
Signed-off-by Tom Goff <[email protected]>--- fs/sysfs/dir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 5 lines
Is this a bug in 3.4-rc1 and older kernels? If so, how old?
thanks,
greg k-h
Yes, this is a bug in 3.4-rc1. The patch is really a change to d5c38b137ac8a6e3dbed13bc494d60df5b69dfc4 'sysfs: Update the name hash when renaming sysfs entries', committed on January 31.
Thanks for looking at this.
Tom
Greg Kroah-Hartman
maintainerQuoted 12 lines · Tom Goff
Quoted 11 lines · Greg Kroah-Hartman
Quoted 7 lines · Tom Goff
This is needed to allow renaming network devices that have been moved to another network namespace.
Signed-off-by Tom Goff <[email protected]>--- fs/sysfs/dir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)Is this a bug in 3.4-rc1 and older kernels? If so, how old?
Quoted 7 lines
Quoted 3 lines
thanks,
greg k-h
Yes, this is a bug in 3.4-rc1. The patch is really a change to
d5c38b137ac8a6e3dbed13bc494d60df5b69dfc4'sysfs: Update the name hash when renaming sysfs entries', committed on January 31.
Good, that patch only went into 3.4-rc1 and nothing newer, I'll queue this up for 3.4-only, thanks for letting me know.
greg k-h