All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 1/6] Rewrite mountns01 test using new LTP API
Date: Tue, 1 Mar 2022 15:35:25 +0100	[thread overview]
Message-ID: <Yh4vLRyB/5wQz+Pq@yuki> (raw)
In-Reply-To: <20220301091517.11142-2-andrea.cervesato@suse.de>

Hi!
Pushed with minor changes, thanks.

- changed the numbered list to simple list in the documentation
  as the three levels of different numbering looked a bit confusing

- changed the license to GPL-2.0 as the original was 2.0 only as well

- removed a few obvious comments, as long as the comment describes
  exactly what the next line does there is no value of keeping it

diff --git a/testcases/kernel/containers/mountns/mountns01.c b/testcases/kernel/containers/mountns/mountns01.c
index f2d67d17a..452fe1d10 100644
--- a/testcases/kernel/containers/mountns/mountns01.c
+++ b/testcases/kernel/containers/mountns/mountns01.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2014 Red Hat, Inc.
  * Copyright (C) 2021 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
@@ -12,21 +12,21 @@
  *
  * [Algorithm]
  *
- * . Creates directories "A", "B" and files "A/A", "B/B"
- * . Unshares mount namespace and makes it private (so mounts/umounts have no
+ * - Creates directories "A", "B" and files "A/A", "B/B"
+ * - Unshares mount namespace and makes it private (so mounts/umounts have no
  *   effect on a real system)
- * . Bind mounts directory "A" to "A"
- * . Makes directory "A" shared
- * . Clones a new child process with CLONE_NEWNS flag
- * . There are two test cases (where X is parent namespace and Y child namespace):
- * .. First test case
- * ... X: bind mounts "B" to "A"
- * ... Y: must see "A/B"
- * ... X: umounts "A"
- * .. Second test case
- * ... Y: bind mounts "B" to "A"
- * ... X: must see "A/B"
- * ... Y: umounts "A"
+ * - Bind mounts directory "A" to "A"
+ * - Makes directory "A" shared
+ * - Clones a new child process with CLONE_NEWNS flag
+ * - There are two test cases (where X is parent namespace and Y child namespace):
+ *  1. First test case
+ *   .. X: bind mounts "B" to "A"
+ *   .. Y: must see "A/B"
+ *   .. X: umounts "A"
+ *  2. Second test case
+ *   .. Y: bind mounts "B" to "A"
+ *   .. X: must see "A/B"
+ *   .. Y: umounts "A"
  */
 
 #include <sys/wait.h>
@@ -59,23 +59,18 @@ static void run(void)
 {
 	int ret;
 
-	/* unshares the mount ns */
 	SAFE_UNSHARE(CLONE_NEWNS);
 
 	/* makes sure parent mounts/umounts have no effect on a real system */
 	SAFE_MOUNT("none", "/", "none", MS_REC | MS_PRIVATE, NULL);
 
-	/* bind mounts DIRA to itself */
 	SAFE_MOUNT(DIRA, DIRA, "none", MS_BIND, NULL);
-
-	/* makes mount DIRA shared */
 	SAFE_MOUNT("none", DIRA, "none", MS_SHARED, NULL);
 
 	ret = ltp_clone_quick(CLONE_NEWNS | SIGCHLD, child_func, NULL);
 	if (ret < 0)
 		tst_brk(TBROK, "clone failed");
 
-	/* bind mounts DIRB to DIRA making contents of DIRB visible in DIRA */
 	SAFE_MOUNT(DIRB, DIRA, "none", MS_BIND, NULL);
 
 	TST_CHECKPOINT_WAKE_AND_WAIT(0);

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-03-01 14:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  9:15 [LTP] [PATCH v3 0/6] Rewrite mountns testing suite Andrea Cervesato
2022-03-01  9:15 ` [LTP] [PATCH v3 1/6] Rewrite mountns01 test using new LTP API Andrea Cervesato
2022-03-01 14:35   ` Cyril Hrubis [this message]
2022-03-01 15:18     ` Cyril Hrubis
2022-03-01  9:15 ` [LTP] [PATCH v3 2/6] Rewrite mountns02 " Andrea Cervesato
2022-03-01  9:15 ` [LTP] [PATCH v3 3/6] Rewrite mountns03 " Andrea Cervesato
2022-03-01  9:15 ` [LTP] [PATCH v3 4/6] Rewrite mountns04 " Andrea Cervesato
2022-03-01  9:15 ` [LTP] [PATCH v3 5/6] Removed obsolete mountns_helper.h Andrea Cervesato
2022-03-01  9:15 ` [LTP] [PATCH v3 6/6] Removed libclone usage from mountns testing suite Andrea Cervesato

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=Yh4vLRyB/5wQz+Pq@yuki \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.