kumquat-buildroot/package/ltp-testsuite/0006-mountns0-1-3-wait-for-umount-completed-in-thread_b.patch
Petr Vorel a7d4356cc7 package/ltp-testsuite: add post release runtime fixes
Backport various post 20220527 release runtime fixes:
* The concept of max runtime
* tst_test.sh: Cleanup getopts usage
* mountns0[1-3]: wait for umount completed in thread_b

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 12:25:30 +02:00

64 lines
1.9 KiB
Diff

From 6d4c8343d33e7d8fa059246310413f029a9e8573 Mon Sep 17 00:00:00 2001
From: Li Wang <liwang@redhat.com>
Date: Thu, 7 Jul 2022 17:38:45 +0800
Subject: [PATCH] mountns0[1-3]: wait for umount completed in thread_b
To get rid of race condition (occurs with umount_folders):
mountns01.c:42: TPASS: shared mount in parent passed
mountns01.c:83: TPASS: shared mount in child passed
tst_device.c:394: TWARN: umount('B') failed with EINVAL
mountns.h:39: TWARN: umount(B) failed: EINVAL (22)
Signed-off-by: Li Wang <liwang@redhat.com>
Reviewed-by: Yang Xu <xuyang2018.jy@fujitsu.com>
[ upstream status: 6d4c8343d33e7d8fa059246310413f029a9e8573 ]
---
testcases/kernel/containers/mountns/mountns01.c | 2 ++
testcases/kernel/containers/mountns/mountns02.c | 2 ++
testcases/kernel/containers/mountns/mountns03.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/testcases/kernel/containers/mountns/mountns01.c b/testcases/kernel/containers/mountns/mountns01.c
index e99134aba..e8f176920 100644
--- a/testcases/kernel/containers/mountns/mountns01.c
+++ b/testcases/kernel/containers/mountns/mountns01.c
@@ -86,6 +86,8 @@ static void run(void)
TST_CHECKPOINT_WAKE(0);
+ SAFE_WAIT(NULL);
+
SAFE_UMOUNT(DIRA);
}
diff --git a/testcases/kernel/containers/mountns/mountns02.c b/testcases/kernel/containers/mountns/mountns02.c
index 258b61217..4b85fa79b 100644
--- a/testcases/kernel/containers/mountns/mountns02.c
+++ b/testcases/kernel/containers/mountns/mountns02.c
@@ -87,6 +87,8 @@ static void run(void)
TST_CHECKPOINT_WAKE(0);
+ SAFE_WAIT(NULL);
+
SAFE_UMOUNT(DIRA);
}
diff --git a/testcases/kernel/containers/mountns/mountns03.c b/testcases/kernel/containers/mountns/mountns03.c
index f37ae7902..1d26a25d8 100644
--- a/testcases/kernel/containers/mountns/mountns03.c
+++ b/testcases/kernel/containers/mountns/mountns03.c
@@ -97,6 +97,8 @@ static void run(void)
TST_CHECKPOINT_WAKE(0);
+ SAFE_WAIT(NULL);
+
SAFE_UMOUNT(DIRA);
}
--
2.37.1