Bug 1384504

Summary: [libcgroup] cgset should return fail when set memory.memsw.limit_in_bytes lower than memory.limit_in_bytes
Product: [Fedora] Fedora Reporter: Nikola Forró <nforro>
Component: libcgroupAssignee: Nikola Forró <nforro>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cye, jchaloup, jsafrane, nforro, varekova
Target Milestone: ---Keywords: EasyFix, Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libcgroup-0.41-10.fc26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1384390 Environment:
Last Closed: 2016-10-13 12:59:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Preserve dirty flag when copying controller values none

Description Nikola Forró 2016-10-13 12:27:54 UTC
+++ This bug was initially created as a clone of Bug #1384390 +++

# cgdelete -g memory:eatmem
# cgcreate -g memory:eatmem
# cgset -r memory.memsw.limit_in_bytes=15M eatmem
# echo $?
0
<===== cgset returned 0 here
# cgget -g memory:eatmem | grep -e memory.limit_in_bytes -e memory.memsw.limit_in_bytes
memory.limit_in_bytes: 9223372036854771712
memory.memsw.limit_in_bytes: 9223372036854771712
# cgset -r memory.limit_in_bytes=15M eatmem
# cgget -g memory:eatmem | grep -e memory.limit_in_bytes -e memory.memsw.limit_in_bytes
memory.limit_in_bytes: 15728640
memory.memsw.limit_in_bytes: 9223372036854771712

# cgdelete -g memory:eatmem
# cgcreate -g memory:eatmem
# echo 15728640 > /sys/fs/cgroup/memory/eatmem/memory.memsw.limit_in_bytes
-bash: echo: write error: Invalid argument
<===== Directly use echo return fail
# echo 15728640 > /sys/fs/cgroup/memory/eatmem/memory.limit_in_bytes
# echo 15728640 > /sys/fs/cgroup/memory/eatmem/memory.memsw.limit_in_bytes
# echo $?
0

Comment 1 Nikola Forró 2016-10-13 12:31:42 UTC
Created attachment 1210053 [details]
Preserve dirty flag when copying controller values