Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 1 | From 6d4c8343d33e7d8fa059246310413f029a9e8573 Mon Sep 17 00:00:00 2001 |
| 2 | From: Li Wang <liwang@redhat.com> |
| 3 | Date: Thu, 7 Jul 2022 17:38:45 +0800 |
| 4 | Subject: [PATCH] mountns0[1-3]: wait for umount completed in thread_b |
| 5 | |
| 6 | To get rid of race condition (occurs with umount_folders): |
| 7 | |
| 8 | mountns01.c:42: TPASS: shared mount in parent passed |
| 9 | mountns01.c:83: TPASS: shared mount in child passed |
| 10 | tst_device.c:394: TWARN: umount('B') failed with EINVAL |
| 11 | mountns.h:39: TWARN: umount(B) failed: EINVAL (22) |
| 12 | |
| 13 | Signed-off-by: Li Wang <liwang@redhat.com> |
| 14 | Reviewed-by: Yang Xu <xuyang2018.jy@fujitsu.com> |
| 15 | Upstream-Status: Backport [6d4c8343d33e7d8fa059246310413f029a9e8573] |
| 16 | --- |
| 17 | testcases/kernel/containers/mountns/mountns01.c | 2 ++ |
| 18 | testcases/kernel/containers/mountns/mountns02.c | 2 ++ |
| 19 | testcases/kernel/containers/mountns/mountns03.c | 2 ++ |
| 20 | 3 files changed, 6 insertions(+) |
| 21 | |
| 22 | diff --git a/testcases/kernel/containers/mountns/mountns01.c b/testcases/kernel/containers/mountns/mountns01.c |
| 23 | index e99134aba..e8f176920 100644 |
| 24 | --- a/testcases/kernel/containers/mountns/mountns01.c |
| 25 | +++ b/testcases/kernel/containers/mountns/mountns01.c |
| 26 | @@ -86,6 +86,8 @@ static void run(void) |
| 27 | |
| 28 | TST_CHECKPOINT_WAKE(0); |
| 29 | |
| 30 | + SAFE_WAIT(NULL); |
| 31 | + |
| 32 | SAFE_UMOUNT(DIRA); |
| 33 | } |
| 34 | |
| 35 | diff --git a/testcases/kernel/containers/mountns/mountns02.c b/testcases/kernel/containers/mountns/mountns02.c |
| 36 | index 258b61217..4b85fa79b 100644 |
| 37 | --- a/testcases/kernel/containers/mountns/mountns02.c |
| 38 | +++ b/testcases/kernel/containers/mountns/mountns02.c |
| 39 | @@ -87,6 +87,8 @@ static void run(void) |
| 40 | |
| 41 | TST_CHECKPOINT_WAKE(0); |
| 42 | |
| 43 | + SAFE_WAIT(NULL); |
| 44 | + |
| 45 | SAFE_UMOUNT(DIRA); |
| 46 | } |
| 47 | |
| 48 | diff --git a/testcases/kernel/containers/mountns/mountns03.c b/testcases/kernel/containers/mountns/mountns03.c |
| 49 | index f37ae7902..1d26a25d8 100644 |
| 50 | --- a/testcases/kernel/containers/mountns/mountns03.c |
| 51 | +++ b/testcases/kernel/containers/mountns/mountns03.c |
| 52 | @@ -97,6 +97,8 @@ static void run(void) |
| 53 | |
| 54 | TST_CHECKPOINT_WAKE(0); |
| 55 | |
| 56 | + SAFE_WAIT(NULL); |
| 57 | + |
| 58 | SAFE_UMOUNT(DIRA); |
| 59 | } |
| 60 | |
| 61 | -- |
| 62 | 2.37.1 |
| 63 | |