diff options
author | Rajat Jain <rajatja@google.com> | 2018-06-16 10:49:46 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-07 17:54:46 +0200 |
commit | c855cf2759d27142f771173d9fd8e7fdf9cf5138 (patch) | |
tree | bdca38399864bfa1900851f1ef1f6248b9debf5a /fs/fs_struct.c | |
parent | 319b11ef5719a2f0ae65ce5f665f263a5e7a06c3 (diff) |
sysfs: Fix internal_create_group() for named group updates
There are a couple of problems with named group updates in the code
today:
* sysfs_update_group() will always fail for a named group, because
internal_create_group() will try to create a new sysfs directory
unconditionally, which will ofcourse fail with -EEXIST.
* We can leak the kernfs_node for grp->name if some one tries to:
- rename a group (change grp->name), or
- update a named group, to an unnamed group
It appears that the whole purpose of sysfs_update_group() was to
allow changing the permissions or visibility of attributes and not
the names. So make it clear in the comments, and allow it to update
an existing named group.
Signed-off-by: Rajat Jain <rajatja@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/fs_struct.c')
0 files changed, 0 insertions, 0 deletions