From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] Fix mountns01/02/03/04 removing unneeded final umounts
Date: Mon, 20 Jun 2022 03:55:53 +0000 [thread overview]
Message-ID: <62AFFE20.1080106@fujitsu.com> (raw)
In-Reply-To: <20220617172641.122296-1-cristian.marussi@arm.com>
Hi Cristian
> Running LTP20220527 release it appears that the recently re-written tests
> mountns02/03/04 now throw a warning on their final umount attempt:
>
> <<<test_output>>>
> tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
> mountns04.c:38: TPASS: unbindable mount passed
> tst_device.c:395: TWARN: umount('A') failed with EINVAL
> mountns.h:36: TWARN: umount(A) failed: EINVAL (22)
> tst_device.c:434: TINFO: No device is mounted at B
I guess this failure because /proc/mounts still has "A", so
tst_is_mounted returns true and umount failed.
we can reproduce it by using a /mnt/A mntpoint in /proc/mounts.
>
> Moreover, the underlying safe_umount() then upgrades the TWARN emitted
> from tst_umount to a TBROK, so causing the test to completely fail:
>
> Summary:
> passed 1
> failed 0
> broken 0
> skipped 0
> warnings 2
> <<<execution_status>>>
> initiation_status="ok"
> duration=0 termination_type=exited termination_id=4 corefile=no
>
> In fact, the final umounts on DIRA seem not needed in mountns02/03/04
> looking at the previous chain of umounts calls and the tests logic and,
> in any case, the .cleanup functions of all these tests take care to
> finally unmount both DIRA/DIRB after having checked if they were still
> mounted at all.
>
> Remove all the final SAFE_UMOUNT calls (even for mountns01) since all the
> possibly needed umounts are already eventually performed by .cleanup.
Yes, it can fix this problem but these case still will fail when
/proc/mounts has a B mntpoint,
ie
mount /dev/sda11 /mnt/B
./mountns04
tst_test.c:1528: TINFO: Timeout per run is 0h 00m 30s
mountns04.c:38: TPASS: unbindable mount passed
tst_device.c:395: TWARN: umount('B') failed with EINVAL
mountns.h:39: TWARN: umount(B) failed: EINVAL (22)
So I think a right fix should fix the tst_is_mounted function or
umount_folders instead of removing final SAFE_UMOUNT.
Best Regards
Yang Xu
>
> Cc: Andrea Cervesato<andrea.cervesato@suse.de>
> Cc: Cyril Hrubis<chrubis@suse.cz>
> Signed-off-by: Cristian Marussi<cristian.marussi@arm.com>
> ---
> testcases/kernel/containers/mountns/mountns01.c | 2 --
> testcases/kernel/containers/mountns/mountns02.c | 2 --
> testcases/kernel/containers/mountns/mountns03.c | 2 --
> testcases/kernel/containers/mountns/mountns04.c | 2 --
> 4 files changed, 8 deletions(-)
>
> diff --git a/testcases/kernel/containers/mountns/mountns01.c b/testcases/kernel/containers/mountns/mountns01.c
> index 452fe1d10..7c9461e4d 100644
> --- a/testcases/kernel/containers/mountns/mountns01.c
> +++ b/testcases/kernel/containers/mountns/mountns01.c
> @@ -85,8 +85,6 @@ static void run(void)
> tst_res(TFAIL, "shared mount in child failed");
>
> TST_CHECKPOINT_WAKE(0);
> -
> - SAFE_UMOUNT(DIRA);
> }
>
> static void setup(void)
> diff --git a/testcases/kernel/containers/mountns/mountns02.c b/testcases/kernel/containers/mountns/mountns02.c
> index cbd435958..0693bb9f6 100644
> --- a/testcases/kernel/containers/mountns/mountns02.c
> +++ b/testcases/kernel/containers/mountns/mountns02.c
> @@ -86,8 +86,6 @@ static void run(void)
> tst_res(TPASS, "private mount in child passed");
>
> TST_CHECKPOINT_WAKE(0);
> -
> - SAFE_UMOUNT(DIRA);
> }
>
> static void setup(void)
> diff --git a/testcases/kernel/containers/mountns/mountns03.c b/testcases/kernel/containers/mountns/mountns03.c
> index 5c19a96a9..aceab32ae 100644
> --- a/testcases/kernel/containers/mountns/mountns03.c
> +++ b/testcases/kernel/containers/mountns/mountns03.c
> @@ -96,8 +96,6 @@ static void run(void)
> tst_res(TFAIL, "propagation form slave mount failed");
>
> TST_CHECKPOINT_WAKE(0);
> -
> - SAFE_UMOUNT(DIRA);
> }
>
> static void setup(void)
> diff --git a/testcases/kernel/containers/mountns/mountns04.c b/testcases/kernel/containers/mountns/mountns04.c
> index cc63a03d9..d0ecf7667 100644
> --- a/testcases/kernel/containers/mountns/mountns04.c
> +++ b/testcases/kernel/containers/mountns/mountns04.c
> @@ -40,8 +40,6 @@ static void run(void)
> SAFE_UMOUNT(DIRB);
> tst_res(TFAIL, "unbindable mount faled");
> }
> -
> - SAFE_UMOUNT(DIRA);
> }
>
> static void setup(void)
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-06-20 3:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 17:26 [LTP] [PATCH] Fix mountns01/02/03/04 removing unneeded final umounts Cristian Marussi
2022-06-20 3:55 ` xuyang2018.jy [this message]
2022-06-20 10:26 ` Cristian Marussi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62AFFE20.1080106@fujitsu.com \
--to=xuyang2018.jy@fujitsu.com \
--cc=cristian.marussi@arm.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox