<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 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 class="">> 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><div><br><div class="gmail_default" style="font-size:small;display:inline">You are right, I'm OK to wait.<br></div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> diff --git a/testcases/kernel/syscalls/<wbr>swapoff/swapoff01.c b/testcases/kernel/syscalls/<wbr>swapoff/swapoff01.c<br>
> index a63e661..b587b0d 100644<br>
> --- a/testcases/kernel/syscalls/<wbr>swapoff/swapoff01.c<br>
> +++ b/testcases/kernel/syscalls/<wbr>swapoff/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="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br><div class="gmail_default" 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><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-- <br>
Cyril Hrubis<br>
<a href="mailto:chrubis@suse.cz">chrubis@suse.cz</a><br>
</font></span></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>