提交 d1753390 编写于 作者: T Tyler Hicks 提交者: David S. Miller

sysfs: Fix regression when adding a file to an existing group

Commit 5f81880d ("sysfs, kobject: allow creating kobject belonging
to arbitrary users") incorrectly changed the argument passed as the
parent parameter when calling sysfs_add_file_mode_ns(). This caused some
sysfs attribute files to not be added correctly to certain groups.

Fixes: 5f81880d ("sysfs, kobject: allow creating kobject belonging to arbitrary users")
Signed-off-by: NTyler Hicks <tyhicks@canonical.com>
Reported-by: NHeiner Kallweit <hkallweit1@gmail.com>
Tested-by: NHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ebe023a4
......@@ -373,7 +373,7 @@ int sysfs_add_file_to_group(struct kobject *kobj,
return -ENOENT;
kobject_get_ownership(kobj, &uid, &gid);
error = sysfs_add_file_mode_ns(kobj->sd, attr, false,
error = sysfs_add_file_mode_ns(parent, attr, false,
attr->mode, uid, gid, NULL);
kernfs_put(parent);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册