Skip to content

Commit d175339

Browse files
tyhicksdavem330
authored andcommitted
sysfs: Fix regression when adding a file to an existing group
Commit 5f81880 ("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: 5f81880 ("sysfs, kobject: allow creating kobject belonging to arbitrary users") Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Reported-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ebe023a commit d175339

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/sysfs/file.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ int sysfs_add_file_to_group(struct kobject *kobj,
373373
return -ENOENT;
374374

375375
kobject_get_ownership(kobj, &uid, &gid);
376-
error = sysfs_add_file_mode_ns(kobj->sd, attr, false,
376+
error = sysfs_add_file_mode_ns(parent, attr, false,
377377
attr->mode, uid, gid, NULL);
378378
kernfs_put(parent);
379379

0 commit comments

Comments
 (0)