Commit fe3de01
kernel/cgroup: use kernfs_create_dir_ns()
By passing the fsugid to kernfs_create_dir_ns(), we don't need
cgroup_kn_set_ugid() any longer. That function was added for exactly
this purpose by commit 49957f8 ("cgroup: newly created dirs and
files should be owned by the creator").
Eliminating this piece of duplicate code means we benefit from future
improvements to kernfs_create_dir_ns(); for example, both are lacking
S_ISGID support currently, which my next patch will add to
kernfs_create_dir_ns(). It cannot (easily) be added to
cgroup_kn_set_ugid() because we can't dereference struct kernfs_iattrs
from there.
--
v1 -> v2: 12-digit commit id
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20231208093310.297233-1-max.kellermann@ionos.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 7c23fb2 commit fe3de01
1 file changed
Lines changed: 4 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4169 | 4169 | | |
4170 | 4170 | | |
4171 | 4171 | | |
4172 | | - | |
4173 | | - | |
4174 | | - | |
4175 | | - | |
4176 | | - | |
4177 | | - | |
4178 | | - | |
4179 | | - | |
4180 | | - | |
4181 | | - | |
4182 | | - | |
4183 | | - | |
4184 | | - | |
4185 | | - | |
4186 | 4172 | | |
4187 | 4173 | | |
4188 | 4174 | | |
| |||
4195 | 4181 | | |
4196 | 4182 | | |
4197 | 4183 | | |
4198 | | - | |
4199 | 4184 | | |
4200 | 4185 | | |
4201 | 4186 | | |
4202 | 4187 | | |
4203 | 4188 | | |
4204 | 4189 | | |
4205 | | - | |
| 4190 | + | |
4206 | 4191 | | |
4207 | 4192 | | |
4208 | 4193 | | |
4209 | 4194 | | |
4210 | 4195 | | |
4211 | | - | |
4212 | | - | |
4213 | | - | |
4214 | | - | |
4215 | | - | |
4216 | | - | |
4217 | 4196 | | |
4218 | 4197 | | |
4219 | 4198 | | |
| |||
5616 | 5595 | | |
5617 | 5596 | | |
5618 | 5597 | | |
5619 | | - | |
| 5598 | + | |
| 5599 | + | |
| 5600 | + | |
5620 | 5601 | | |
5621 | 5602 | | |
5622 | 5603 | | |
| |||
5761 | 5742 | | |
5762 | 5743 | | |
5763 | 5744 | | |
5764 | | - | |
5765 | | - | |
5766 | | - | |
5767 | | - | |
5768 | 5745 | | |
5769 | 5746 | | |
5770 | 5747 | | |
| |||
0 commit comments