> On Feb. 20, 2024, 4:43 a.m., Benjamin Mahler wrote:
> > src/linux/cgroups2.hpp
> > Lines 83-96 (patched)
> > <https://reviews.apache.org/r/74874/diff/1/?file=2285175#file2285175line83>
> >
> >     hm.. this doesn't seem needed? the below can just be:
> >     
> >     ```
> >     Try<Nothing> write(
> >       const string& cgroup, 
> >       const string& control, 
> >       const string& value)
> >     {
> >       return os::write(
> >           path::join(*cgroups2::rootMountPoint, cgroup, control),
> >           value);
> >     ```
> 
> Devin Leamy wrote:
>     The justification is explained in the comment. TLDR: The path needs to be 
> normalized. The suggested code could result in a write to <root>//<control> 
> instead of the desired <root>/<control>.

Hm.. looks like an issue with path::join, we can send a different patch outside 
of this patchset to fix that:

```
$ python3
>>> import os
>>> os.path.join("/some/path", "", "control")
'/some/path/control'
```

we probably just never expected callers to pass empty path components into path 
join


- Benjamin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74874/#review226225
-----------------------------------------------------------


On Feb. 26, 2024, 10:12 p.m., Devin Leamy wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74874/
> -----------------------------------------------------------
> 
> (Updated Feb. 26, 2024, 10:12 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Introduces:
> - `cgroups2::read()`: Read a control file to a string.
> - `cgroups2::write()`: Write a string to a control file.
> reading and writing primitives for controls.
> 
> 
> Diffs
> -----
> 
>   src/linux/cgroups2.hpp 833960d301335541f0bb7ad5c0e05e7222d7bc06 
>   src/linux/cgroups2.cpp 6beb8dd2c43f548dd86be16e828b4abfe6fa3fd3 
> 
> 
> Diff: https://reviews.apache.org/r/74874/diff/3/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Devin Leamy
> 
>

Reply via email to