Skip to contentSkip to conversation

memcg_control: fix mem_process not moved to cgroup

PATCH In review Vladimir Davydov 2 participants 2 messages Jul 22, 2015 – Jul 28, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memcg_control: fix mem_process not moved to cgroup

$! is not set after ( cmd & )

This bug was introduced by commit 49010e502a74c ("Replace pushd // popd with cd calls.").

Since we create a sub-shell in test_proc_kill only to preserve PWD, let's change this to cd $OLDPWD. In contrast to pushd/popd this will work in busybox.

---
 testcases/kernel/controllers/memcg/control/memcg_control_test.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
testcases/kernel/controllers/memcg/control/memcg_control_test.sh +3 -1
index fa50516ba71b..168efe3ee35c 100644
@@ -54,7 +54,9 @@ FAIL=1
 # Check if the test process is killed on crossing boundary
 test_proc_kill()
 {
-	( cd $TMP && mem_process -m $PROC_MEM & )
+	cd $TMP
+	mem_process -m $PROC_MEM &
+	cd $OLDPWD
 	sleep 1
 	echo $! > tasks
 
Signature · 8 lines
2.1.4


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

----- Original Message -----

Quoted 7 lines

From: "Vladimir Davydov" <[email protected]>
To: [email protected]
Sent: Monday, 20 July, 2015 4:47:11 PM
Subject: [LTP] [PATCH] memcg_control: fix mem_process not moved to cgroup

$! is not set after ( cmd & )

Quoted 8 lines

This bug was introduced by commit 49010e502a74c ("Replace pushd // popd with cd calls.").

Since we create a sub-shell in test_proc_kill only to preserve PWD, let's change this to cd $OLDPWD. In contrast to pushd/popd this will work in busybox.

Pushed.

Thank you,
Jan

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list