Skip to content

cgroupv2: never write empty string to memory.swap.max#2410

Merged
mrunalp merged 1 commit into
opencontainers:masterfrom
lifubang:swap0patch
May 18, 2020
Merged

cgroupv2: never write empty string to memory.swap.max#2410
mrunalp merged 1 commit into
opencontainers:masterfrom
lifubang:swap0patch

Conversation

@lifubang
Copy link
Copy Markdown
Member

Never write empty string to memory.swap.max
Because the empty string means set swap to 0.

For example:
with memory limit:

"memory": {
        "limit": 33554432,
        "swap": 33558528
 }

The value of memory.swap.max is 4096.
After we run runc update --memory 33554432 test, the value of memory.swap.max becomes 0.
This is a regression introduced by #2370 . I'm so sorry.

Signed-off-by: lifubang lifubang@acmcoder.com

Because the empty string means set swap to 0.

Signed-off-by: lifubang <lifubang@acmcoder.com>
@kolyshkin
Copy link
Copy Markdown
Contributor

kolyshkin commented May 15, 2020

LGTM

Approved with PullApprove

@kolyshkin
Copy link
Copy Markdown
Contributor

@AkihiroSuda @mrunalp PTAL

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented May 18, 2020

LGTM

Approved with PullApprove

@mrunalp mrunalp merged commit 67fac52 into opencontainers:master May 18, 2020
@lifubang lifubang deleted the swap0patch branch May 28, 2020 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants