cgroup/cgroup_regression_test: Fix umount failure
PATCH v3 2/2 cgroup/cgroup_regression_test: Fix umount failure
The test sequence
mount -t cgroup -o <controllers> <path> mkdir <path>/<dir> rmdir <path>/<dir> umount <path> mount -t cgroup -o <controllers> <path>
would easily fail at the last mount with -EBUSY on certain platform.
The reason is that this test sequence would have the chance of missing a release code path when doing rmdir and umount.
Adding a little delay between "rmdir" and "umount" could fix the problem, so use tst_umount API instead of umount in "rmdir, umount" sequence.
--- .../controllers/cgroup/cgroup_regression_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +5 -5
@@ -145,7 +145,7 @@ test2() fi rmdir cgroup/0 cgroup/1 - umount cgroup/ + tst_umount cgroup/ } #---------------------------------------------------------------------------
@@ -193,7 +193,7 @@ test3() wait $pid2 2>/dev/null rmdir $cpu_subsys_path/0 2> /dev/null - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }
@@ -222,7 +222,7 @@ test4() mount -t cgroup -o none,name=foo cgroup cgroup/ mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ + tst_umount cgroup/ if dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"; then tst_res TFAIL "lockdep BUG was found"
@@ -254,7 +254,7 @@ test5() mount -t cgroup none cgroup 2> /dev/null mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }
@@ -290,7 +290,7 @@ test6() mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1 rmdir cgroup/[1-9]* > /dev/null 2>&1 - umount cgroup/ + tst_umount cgroup/ check_kernel_bug }
Signature · 1 line
2.17.0
PATCH v3 2/2 cgroup/cgroup_regression_test: Fix umount failure
Hi Leo
Quoted 26 lines
The test sequence
mount -t cgroup -o<controllers> <path> mkdir<path>/<dir> rmdir<path>/<dir> umount<path> mount -t cgroup -o<controllers> <path>would easily fail at the last mount with
-EBUSYon certain platform.The reason is that this test sequence would have the chance of missing a release code path when doing rmdir and umount.
Adding a little delay between "rmdir" and "umount" could fix the problem, so use
tst_umountAPI instead of umount in "rmdir, umount" sequence.Fixes #839Signed-off-by Leo Yu-Chi Liang<[email protected]>--- .../controllers/cgroup/cgroup_regression_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-0
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test2() · line 148
Quoted 4 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-1@@ -145,7 +145,7 @@ test2() fi rmdir cgroup/0 cgroup/1 - umount cgroup/
With adding a comment like
# Avoid possible EBUSY error
so when other converts this case into new api, they will keep to use tst_umount.
Quoted 14 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +2
-1+ tst_umount cgroup/ } #---------------------------------------------------------------------------@@ -193,7 +193,7 @@ test3() wait $pid2 2>/dev/null rmdir $cpu_subsys_path/0 2> /dev/null - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test4() · line 225
Quoted 5 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1@@ -222,7 +222,7 @@ test4() mount -t cgroup -o none,name=foo cgroup cgroup/ mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ + tst_umount cgroup/
here as well
Quoted 13 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1if dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"; then tst_res TFAIL "lockdep BUG was found"@@ -254,7 +254,7 @@ test5() mount -t cgroup none cgroup 2> /dev/null mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test6() · line 293
Quoted 5 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1@@ -290,7 +290,7 @@ test6() mount -t cgroup -o ns xxx cgroup/> /dev/null 2>&1 rmdir cgroup/[1-9]*> /dev/null 2>&1 - umount cgroup/ + tst_umount cgroup/
here as well
Quoted 3 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-0check_kernel_bug }
PATCH v3 2/2 cgroup/cgroup_regression_test: Fix umount failure
Quoted 29 lines
Hi Leo
Quoted 27 lines
The test sequence
mount -t cgroup -o<controllers> <path> mkdir<path>/<dir> rmdir<path>/<dir> umount<path> mount -t cgroup -o<controllers> <path>would easily fail at the last mount with
-EBUSYon certain platform.The reason is that this test sequence would have the chance of missing a release code path when doing rmdir and umount.
Adding a little delay between "rmdir" and "umount" could fix the problem, so use
tst_umountAPI instead of umount in "rmdir, umount" sequence.Fixes #839Signed-off-by Leo Yu-Chi Liang<[email protected]>--- .../controllers/cgroup/cgroup_regression_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-0@@ -145,7 +145,7 @@ test2() fi
Quoted 7 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test2() · line 148
Quoted 2 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-1rmdir cgroup/0 cgroup/1 - umount cgroup/With adding a comment like
# Avoid possible EBUSY errorso when other converts this case into new api, they will keep to use
tst_umount.
+1
Kind regards,
Petr
Quoted 43 lines
Reviewed-by Yang Xu <[email protected]>Quoted 14 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +2
-1+ tst_umount cgroup/ } #---------------------------------------------------------------------------@@ -193,7 +193,7 @@ test3() wait $pid2 2>/dev/null rmdir $cpu_subsys_path/0 2> /dev/null - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test4() · line 225
Quoted 5 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1@@ -222,7 +222,7 @@ test4() mount -t cgroup -o none,name=foo cgroup cgroup/ mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ + tst_umount cgroup/here as well
Quoted 12 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1if dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"; then tst_res TFAIL "lockdep BUG was found"@@ -254,7 +254,7 @@ test5() mount -t cgroup none cgroup 2> /dev/null mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test6() · line 293
Quoted 5 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1@@ -290,7 +290,7 @@ test6() mount -t cgroup -o ns xxx cgroup/> /dev/null 2>&1 rmdir cgroup/[1-9]*> /dev/null 2>&1 - umount cgroup/ + tst_umount cgroup/here as well
Quoted 2 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-0check_kernel_bug }
PATCH v3 2/2 cgroup/cgroup_regression_test: Fix umount failure
In reply to Leo LiangQuoted 26 lines
The test sequence
mount -t cgroup -o <controllers> <path> mkdir <path>/<dir> rmdir <path>/<dir> umount <path> mount -t cgroup -o <controllers> <path>would easily fail at the last mount with
-EBUSYon certain platform.The reason is that this test sequence would have the chance of missing a release code path when doing rmdir and umount.
Adding a little delay between "rmdir" and "umount" could fix the problem, so use
tst_umountAPI instead of umount in "rmdir, umount" sequence.Fixes #839Signed-off-by Leo Yu-Chi Liang <[email protected]>--- .../controllers/cgroup/cgroup_regression_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-0
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test2() · line 148
Quoted 5 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1@@ -145,7 +145,7 @@ test2() fi rmdir cgroup/0 cgroup/1 - umount cgroup/ + tst_umount cgroup/
As I note in previous patch, with suggested change to tst_umount() to always add trailing "/" it'd be enough just "tst_umount cgroup".
I'm not sure what is better: automatic handling or having to explicitly add trailing "/".
Kind regards,
Petr
Quoted 38 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +4
-4} #---------------------------------------------------------------------------@@ -193,7 +193,7 @@ test3() wait $pid2 2>/dev/null rmdir $cpu_subsys_path/0 2> /dev/null - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }@@ -222,7 +222,7 @@ test4() mount -t cgroup -o none,name=foo cgroup cgroup/ mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ + tst_umount cgroup/ if dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"; then tst_res TFAIL "lockdep BUG was found"@@ -254,7 +254,7 @@ test5() mount -t cgroup none cgroup 2> /dev/null mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }@@ -290,7 +290,7 @@ test6() mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1 rmdir cgroup/[1-9]* > /dev/null 2>&1 - umount cgroup/ + tst_umount cgroup/ check_kernel_bug }
PATCH v3 2/2 cgroup/cgroup_regression_test: Fix umount failure
In reply to [email protected]Hi Yang,
Quoted 29 lines · On Mon, Jul 19, 2021 at 01:24:12PM +0800, [email protected] wrote:
Hi Leo
Quoted 28 lines
The test sequence
mount -t cgroup -o<controllers> <path> mkdir<path>/<dir> rmdir<path>/<dir> umount<path> mount -t cgroup -o<controllers> <path>would easily fail at the last mount with
-EBUSYon certain platform.The reason is that this test sequence would have the chance of missing a release code path when doing rmdir and umount.
Adding a little delay between "rmdir" and "umount" could fix the problem, so use
tst_umountAPI instead of umount in "rmdir, umount" sequence.Fixes #839Signed-off-by Leo Yu-Chi Liang<[email protected]>--- .../controllers/cgroup/cgroup_regression_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-0@@ -145,7 +145,7 @@ test2() fi
Quoted 8 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test2() · line 148
Quoted 2 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-1rmdir cgroup/0 cgroup/1 - umount cgroup/With adding a comment like
# Avoid possible EBUSY errorso when other converts this case into new api, they will keep to use
tst_umount.
No problem! Will do in the next version!
Thanks!
Best regards,
Leo
Quoted 43 lines
Reviewed-by Yang Xu <[email protected]>Quoted 14 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +2
-1+ tst_umount cgroup/ } #---------------------------------------------------------------------------@@ -193,7 +193,7 @@ test3() wait $pid2 2>/dev/null rmdir $cpu_subsys_path/0 2> /dev/null - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test4() · line 225
Quoted 5 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1@@ -222,7 +222,7 @@ test4() mount -t cgroup -o none,name=foo cgroup cgroup/ mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ + tst_umount cgroup/here as well
Quoted 13 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1if dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"; then tst_res TFAIL "lockdep BUG was found"@@ -254,7 +254,7 @@ test5() mount -t cgroup none cgroup 2> /dev/null mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test6() · line 293
Quoted 5 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1@@ -290,7 +290,7 @@ test6() mount -t cgroup -o ns xxx cgroup/> /dev/null 2>&1 rmdir cgroup/[1-9]*> /dev/null 2>&1 - umount cgroup/ + tst_umount cgroup/here as well
Quoted 3 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-0check_kernel_bug }
PATCH v3 2/2 cgroup/cgroup_regression_test: Fix umount failure
In reply to Petr VorelHi Petr,
Quoted 28 lines · Petr Vorel
Quoted 27 lines
The test sequence
mount -t cgroup -o <controllers> <path> mkdir <path>/<dir> rmdir <path>/<dir> umount <path> mount -t cgroup -o <controllers> <path>would easily fail at the last mount with
-EBUSYon certain platform.The reason is that this test sequence would have the chance of missing a release code path when doing rmdir and umount.
Adding a little delay between "rmdir" and "umount" could fix the problem, so use
tst_umountAPI instead of umount in "rmdir, umount" sequence.Fixes #839Signed-off-by Leo Yu-Chi Liang <[email protected]>--- .../controllers/cgroup/cgroup_regression_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0
-0@@ -145,7 +145,7 @@ test2() fi
Quoted 6 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh test2() · line 148
Quoted 3 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +1
-1rmdir cgroup/0 cgroup/1 - umount cgroup/ + tst_umount cgroup/As I note in previous patch, with suggested change to
tst_umount()to always add trailing "/" it'd be enough just "tst_umountcgroup".
I think your method is better that we don't alter the argument passed into tst_umount. Let users decide the argument and honor the choice.
I will send a v4 patch later and still keep the trailing slash.
Thanks!
Best regards,
Leo
Quoted 44 lines
I'm not sure what is better: automatic handling or having to explicitly add trailing "/".
Kind regards,
PetrQuoted 38 lines
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +4
-4} #---------------------------------------------------------------------------@@ -193,7 +193,7 @@ test3() wait $pid2 2>/dev/null rmdir $cpu_subsys_path/0 2> /dev/null - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }@@ -222,7 +222,7 @@ test4() mount -t cgroup -o none,name=foo cgroup cgroup/ mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ + tst_umount cgroup/ if dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"; then tst_res TFAIL "lockdep BUG was found"@@ -254,7 +254,7 @@ test5() mount -t cgroup none cgroup 2> /dev/null mkdir cgroup/0 rmdir cgroup/0 - umount cgroup/ 2> /dev/null + tst_umount cgroup/ 2> /dev/null check_kernel_bug }@@ -290,7 +290,7 @@ test6() mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1 rmdir cgroup/[1-9]* > /dev/null 2>&1 - umount cgroup/ + tst_umount cgroup/ check_kernel_bug }