diff options
author | Tyler Hicks <tyhicks@canonical.com> | 2018-07-27 21:33:27 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-29 13:11:28 -0700 |
commit | d1753390274f7760e5b593cb657ea34f0617e559 (patch) | |
tree | bf1b53ec2bd412bbee30ef32128769447b31bb86 | |
parent | ebe023a4248834f774d537898898ce7bcbec0958 (diff) | |
download | op-kernel-dev-d1753390274f7760e5b593cb657ea34f0617e559.zip op-kernel-dev-d1753390274f7760e5b593cb657ea34f0617e559.tar.gz |
sysfs: Fix regression when adding a file to an existing group
Commit 5f81880d5204 ("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: 5f81880d5204 ("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>
-rw-r--r-- | fs/sysfs/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index fa46216..052e5ad 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -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); |