Repository navigation
Commit 5f46990
committed
cgroup: update the meaning of cftype->max_write_len
cftype->max_write_len is used to extend the maximum size of writes.
It's interpreted in such a way that the actual maximum size is one
less than the specified value. The default size is defined by
CGROUP_LOCAL_BUFFER_SIZE. Its interpretation is quite confusing - its
value is decremented by 1 and then compared for equality with max
size, which means that the actual default size is
CGROUP_LOCAL_BUFFER_SIZE - 2, which is 62 chars.
There's no point in having a limit that low. Update its definition so
that it means the actual string length sans termination and anything
below PAGE_SIZE-1 is treated as PAGE_SIZE-1.
.max_write_len for "release_agent" is updated to PATH_MAX-1 and
cgroup_release_agent_write() is updated so that the redundant strlen()
check is removed and it uses strlcpy() instead of strcpy().
.max_write_len initializations in blk-throttle.c and cfq-iosched.c are
no longer necessary and removed. The one in cpuset is kept unchanged
as it's an approximated value to begin with.
This will also make transition to kernfs smoother.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>1 parent de00ffa commit 5f46990
4 files changed
Lines changed: 11 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
1428 | | - | |
1429 | 1428 | | |
1430 | 1429 | | |
1431 | 1430 | | |
1432 | 1431 | | |
1433 | 1432 | | |
1434 | 1433 | | |
1435 | | - | |
1436 | 1434 | | |
1437 | 1435 | | |
1438 | 1436 | | |
1439 | 1437 | | |
1440 | 1438 | | |
1441 | 1439 | | |
1442 | | - | |
1443 | 1440 | | |
1444 | 1441 | | |
1445 | 1442 | | |
1446 | 1443 | | |
1447 | 1444 | | |
1448 | 1445 | | |
1449 | | - | |
1450 | 1446 | | |
1451 | 1447 | | |
1452 | 1448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1838 | 1838 | | |
1839 | 1839 | | |
1840 | 1840 | | |
1841 | | - | |
1842 | 1841 | | |
1843 | 1842 | | |
1844 | 1843 | | |
| |||
1853 | 1852 | | |
1854 | 1853 | | |
1855 | 1854 | | |
1856 | | - | |
1857 | 1855 | | |
1858 | 1856 | | |
1859 | 1857 | | |
| |||
1866 | 1864 | | |
1867 | 1865 | | |
1868 | 1866 | | |
1869 | | - | |
1870 | 1867 | | |
1871 | 1868 | | |
1872 | 1869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
404 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2213 | 2213 | | |
2214 | 2214 | | |
2215 | 2215 | | |
2216 | | - | |
2217 | | - | |
2218 | | - | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
2219 | 2219 | | |
2220 | 2220 | | |
2221 | 2221 | | |
2222 | | - | |
| 2222 | + | |
| 2223 | + | |
2223 | 2224 | | |
2224 | 2225 | | |
2225 | 2226 | | |
| |||
2245 | 2246 | | |
2246 | 2247 | | |
2247 | 2248 | | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | 2249 | | |
2252 | 2250 | | |
2253 | 2251 | | |
2254 | 2252 | | |
2255 | 2253 | | |
2256 | 2254 | | |
2257 | | - | |
| 2255 | + | |
2258 | 2256 | | |
2259 | 2257 | | |
2260 | 2258 | | |
2261 | | - | |
| 2259 | + | |
2262 | 2260 | | |
2263 | 2261 | | |
2264 | 2262 | | |
| |||
3919 | 3917 | | |
3920 | 3918 | | |
3921 | 3919 | | |
3922 | | - | |
| 3920 | + | |
3923 | 3921 | | |
3924 | 3922 | | |
3925 | 3923 | | |
| |||
0 commit comments