cgroup: Parse infinity properly for memory protections
This fixes commit db2b8d2e28 that
rectified parsing empty values but broke parsing explicit infinity.
Intended parsing semantics will be captured in a testcase in a follow up
commit.
Ref: #16248
This commit is contained in:
@@ -3427,13 +3427,12 @@ int config_parse_memory_limit(
|
||||
uint64_t bytes = CGROUP_LIMIT_MAX;
|
||||
int r;
|
||||
|
||||
if (STR_IN_SET(lvalue, "DefaultMemoryLow",
|
||||
"DefaultMemoryMin",
|
||||
"MemoryLow",
|
||||
"MemoryMin"))
|
||||
if (isempty(rvalue) && STR_IN_SET(lvalue, "DefaultMemoryLow",
|
||||
"DefaultMemoryMin",
|
||||
"MemoryLow",
|
||||
"MemoryMin"))
|
||||
bytes = CGROUP_LIMIT_MIN;
|
||||
|
||||
if (!isempty(rvalue) && !streq(rvalue, "infinity")) {
|
||||
else if (!isempty(rvalue) && !streq(rvalue, "infinity")) {
|
||||
|
||||
r = parse_permille(rvalue);
|
||||
if (r < 0) {
|
||||
|
||||
Reference in New Issue
Block a user