<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><font size="4">Hi Petr,</font></p>
<p><font size="4">I think this patch can be avoided at this point<br>
</font></p>
<p><font size="4">Andrea</font><br>
</p>
<div class="moz-cite-prefix">On 3/25/22 08:18, Petr Vorel wrote:<br>
</div>
<blockquote type="cite" cite="mid:Yj1s2cKWf7oNwSVR@pevik">
<pre class="moz-quote-pre" wrap="">Hi Andrea,
[Cc Richie]
This subject: "Rewrite userns08.c using new LTP API" is misleading,
userns08.c was already using new API.
You're:
* s/tst_res/tst_brk/ (that would deserve explanation why)
* removing tst_reap_children()
* changing formatting (some of them create too long lines)
...
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> static pid_t clone_newuser(void)
{
- const struct tst_clone_args cargs = {
- CLONE_NEWUSER,
- SIGCHLD
- };
+ const struct tst_clone_args cargs = { CLONE_NEWUSER, SIGCHLD };
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> return SAFE_CLONE(&cargs);
}
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">-static void write_mapping(const pid_t proc_in_ns,
- const char *const id_mapping)
+static void write_mapping(const pid_t proc_in_ns, const char *const id_mapping)
{
char proc_path[PATH_MAX];
int proc_dir;
@@ -61,11 +58,11 @@ static void write_mapping(const pid_t proc_in_ns,
static void ns_level2(void)
{
if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0))
- tst_res(TINFO | TERRNO, "Failed to set dumpable flag");
+ tst_brk(TBROK | TTERRNO, "Failed to set dumpable flag");
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">Not sure which one is correct (whether tst_res or tst_brk).
But TTERRNO is obviously wrong, that's for using TEST(). Here should remain
TERRNO.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">+
TST_CHECKPOINT_WAKE_AND_WAIT(1);
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">- TST_EXP_FAIL(open("restricted", O_WRONLY), EACCES,
- "Denied write access to ./restricted");
+ TST_EXP_FAIL(open("restricted", O_WRONLY), EACCES, "Denied write access to ./restricted");
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
I'd keep this one.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> exit(0);
}
@@ -89,7 +86,6 @@ static void ns_level1(void)
write_mapping(level2_proc, map_over_5);
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> TST_CHECKPOINT_WAKE(1);
- tst_reap_children();
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">Well, test works without it, but not really sure if it can be removed.
Kind regards,
Petr
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> exit(0);
}
@@ -111,7 +107,6 @@ static void run(void)
write_mapping(level1_proc, "0 100000 1000");
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> TST_CHECKPOINT_WAKE(0);
- tst_reap_children();
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</body>
</html>