<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 12, 2018 at 9:05 PM, Li Wang <span dir="ltr"><<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small"><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Jun 12, 2018 at 8:48 PM, Cyril Hrubis <span dir="ltr"><<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<span>> Testcase include swapon(8) fails on mainline kernel-v4.17+ as:<br>
> swapon01 1 TFAIL : swapon01.c:47: Failed to turn on swapfile: TEST_ERRNO=EINVAL(22): Invalid argument<br>
> swapon02 4 TFAIL : swapon02.c:91: swapon(2) failed to produce expected error: 16, errno: EBUSY and got 22.<br>
> swapon03 1 TFAIL : swapon03.c:243: Failed to setup swaps<br>
> swapoff01 1 TBROK : swapoff01.c:64: Failed to turn on the swap file, skipping test iteration<br>
<br>
</span>4.17+ means that this is yet to be release kernel, right? In that<br>
situation we wait if the change will survive upon the official release<br>
before changing the LTP test.<br></blockquote></span><div><br><div style="font-size:small;display:inline">You are right, I'm OK to wait.<br></div> </div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
> diff --git a/testcases/kernel/syscalls/sw<wbr>apoff/swapoff01.c b/testcases/kernel/syscalls/sw<wbr>apoff/swapoff01.c<br>
> index a63e661..b587b0d 100644<br>
> --- a/testcases/kernel/syscalls/sw<wbr>apoff/swapoff01.c<br>
> +++ b/testcases/kernel/syscalls/sw<wbr>apoff/swapoff01.c<br>
> @@ -105,6 +105,8 @@ static void setup(void)<br>
> <br>
> if (system("mkswap swapfile01 > tmpfile 2>&1") != 0)<br>
> tst_brkm(TBROK, cleanup, "Failed to make swapfile");<br>
> +<br>
> + sync();<br>
<br>
</span>Can we rather use fsync() and/or fdatasync()? I would like the avoid the<br>
system wide sync() here since that may slow down the test unnecessarily.<br>
<span class="m_-7987397950180156170HOEnZb"><font color="#888888"><br></font></span></blockquote></span><div><br><div style="font-size:small">Actually I tried to add fsync() and syncfs() in tst_fill_file.c first, but it does NOT works for me. After tracking more, I found that we have to sync up caches in front of the command `mkswap swapfile`.</div></div></div></div></div></blockquote><div><br><div class="gmail_default" style="font-size:small;display:inline">Oops, this is wrong description, not in front of that.<br><br></div><div class="gmail_default" style="font-size:small;display:inline">Should be done sync again after perform command `mkswap swapfile`.<br></div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span class="HOEnZb"><font color="#888888"><br> </font></span></div><span class="HOEnZb"><font color="#888888"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="m_-7987397950180156170HOEnZb"><font color="#888888">
-- <br>
Cyril Hrubis<br>
<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a><br>
</font></span></blockquote></font></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="m_-7987397950180156170gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div>
</div></div>