<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:宋体;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:宋体;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML 预设格式 Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:宋体;}
span.HTMLChar
        {mso-style-name:"HTML 预设格式 Char";
        mso-style-priority:99;
        mso-style-link:"HTML 预设格式";
        font-family:"Courier New";}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks for your review!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">It seems better that add a check of lower bound, I have resubmit the patch, please see:
<a href="https://patchwork.ozlabs.org/project/ltp/patch/20220408091733.15323-1-zhaogongyi@huawei.com/">
https://patchwork.ozlabs.org/project/ltp/patch/20220408091733.15323-1-zhaogongyi@huawei.com/</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">Best Wishes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">GONGYI<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p><span lang="EN-US" style="font-size:13.5pt">Hi Zhao,</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-size:13.5pt">Thanks for the patch. Please consider the following review.</span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On 4/8/22 09:54, Andrea Cervesato via ltp wrote:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p><span lang="EN-US" style="font-size:13.5pt">Hi!</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-size:13.5pt">Thanks for the patch.</span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On 4/7/22 09:57, Zhao Gongyi via ltp wrote:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">Add test verifies EINVAL for invalid nr_futexes according to<o:p></o:p></span></pre>
<pre><span lang="EN-US"><a href="https://www.kernel.org/doc/html/latest/userspace-api/futex2.html">https://www.kernel.org/doc/html/latest/userspace-api/futex2.html</a>.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">Signed-off-by: Zhao Gongyi <a href="mailto:zhaogongyi@huawei.com"><zhaogongyi@huawei.com></a><o:p></o:p></span></pre>
<pre><span lang="EN-US">---<o:p></o:p></span></pre>
<pre><span lang="EN-US"> testcases/kernel/syscalls/futex/futex_waitv01.c | 12 ++++++++++++<o:p></o:p></span></pre>
<pre><span lang="EN-US"> 1 file changed, 12 insertions(+)<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">diff --git a/testcases/kernel/syscalls/futex/futex_waitv01.c b/testcases/kernel/syscalls/futex/futex_waitv01.c<o:p></o:p></span></pre>
<pre><span lang="EN-US">index 601fee8df..525420647 100644<o:p></o:p></span></pre>
<pre><span lang="EN-US">--- a/testcases/kernel/syscalls/futex/futex_waitv01.c<o:p></o:p></span></pre>
<pre><span lang="EN-US">+++ b/testcases/kernel/syscalls/futex/futex_waitv01.c<o:p></o:p></span></pre>
<pre><span lang="EN-US">@@ -98,6 +98,17 @@ static void test_invalid_clockid(void)<o:p></o:p></span></pre>
<pre><span lang="EN-US">               "futex_waitv invalid clockid");<o:p></o:p></span></pre>
<pre><span lang="EN-US"> }<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">+static void test_invalid_nr_futex(void)<o:p></o:p></span></pre>
<pre><span lang="EN-US">+{<o:p></o:p></span></pre>
<pre><span lang="EN-US">+ struct timespec to;<o:p></o:p></span></pre>
<pre><span lang="EN-US">+ init_waitv();<o:p></o:p></span></pre>
<pre><span lang="EN-US">+ init_timeout(&to);<o:p></o:p></span></pre>
<pre><span lang="EN-US">+<o:p></o:p></span></pre>
<pre><span lang="EN-US">+ /* Valid nr_futex is [1, 128] */<o:p></o:p></span></pre>
<pre><span lang="EN-US">+ TST_EXP_FAIL(futex_waitv(waitv, 129, 0, &to, CLOCK_REALTIME), EINVAL,<o:p></o:p></span></pre>
<pre><span lang="EN-US">+              "futex_waitv invalid nr_futex");<o:p></o:p></span></pre>
</blockquote>
<p><span lang="EN-US">Can you please check also lower bound? So we'll check for 0 as well.<o:p></o:p></span></p>
<pre><span lang="EN-US"> TST_EXP_FAIL(futex_waitv(waitv, 0, 0, &to, CLOCK_REALTIME), EINVAL,<o:p></o:p></span></pre>
<pre><span lang="EN-US">             "futex_waitv invalid nr_futex");<o:p></o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">+}<o:p></o:p></span></pre>
<pre><span lang="EN-US">+<o:p></o:p></span></pre>
<pre><span lang="EN-US"> static void run(void)<o:p></o:p></span></pre>
<pre><span lang="EN-US"> {<o:p></o:p></span></pre>
<pre><span lang="EN-US">  test_invalid_flags();<o:p></o:p></span></pre>
<pre><span lang="EN-US">@@ -105,6 +116,7 @@ static void run(void)<o:p></o:p></span></pre>
<pre><span lang="EN-US">  test_null_address();<o:p></o:p></span></pre>
<pre><span lang="EN-US">  test_null_waiters();<o:p></o:p></span></pre>
<pre><span lang="EN-US">  test_invalid_clockid();<o:p></o:p></span></pre>
<pre><span lang="EN-US">+ test_invalid_nr_futex();<o:p></o:p></span></pre>
<pre><span lang="EN-US"> }<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US"> static struct tst_test test = {<o:p></o:p></span></pre>
<pre><span lang="EN-US">--<o:p></o:p></span></pre>
<pre><span lang="EN-US">2.17.1<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
</blockquote>
<p><span lang="EN-US">Otherwise LGTM.<o:p></o:p></span></p>
<p><span lang="EN-US">Andrea Cervesato<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><br>
<br>
<o:p></o:p></span></p>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
</blockquote>
</div>
</div>
</body>
</html>