Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] swapon: commit swapfile caches to disk
Date: Tue, 12 Jun 2018 14:48:22 +0200	[thread overview]
Message-ID: <20180612124822.GA18870@rei> (raw)
In-Reply-To: <1528806239-14297-1-git-send-email-liwang@redhat.com>

Hi!
> Testcase include swapon(8) fails on mainline kernel-v4.17+ as:
>   swapon01    1  TFAIL  :  swapon01.c:47: Failed to turn on swapfile: TEST_ERRNO=EINVAL(22): Invalid argument
>   swapon02    4  TFAIL  :  swapon02.c:91: swapon(2) failed to produce expected error: 16, errno: EBUSY and got 22.
>   swapon03    1  TFAIL  :  swapon03.c:243: Failed to setup swaps
>   swapoff01   1  TBROK  :  swapoff01.c:64: Failed to turn on the swap file, skipping test iteration

4.17+ means that this is yet to be release kernel, right? In that
situation we wait if the change will survive upon the official release
before changing the LTP test.

> diff --git a/testcases/kernel/syscalls/swapoff/swapoff01.c b/testcases/kernel/syscalls/swapoff/swapoff01.c
> index a63e661..b587b0d 100644
> --- a/testcases/kernel/syscalls/swapoff/swapoff01.c
> +++ b/testcases/kernel/syscalls/swapoff/swapoff01.c
> @@ -105,6 +105,8 @@ static void setup(void)
>  
>  	if (system("mkswap swapfile01 > tmpfile 2>&1") != 0)
>  		tst_brkm(TBROK, cleanup, "Failed to make swapfile");
> +
> +	sync();

Can we rather use fsync() and/or fdatasync()? I would like the avoid the
system wide sync() here since that may slow down the test unnecessarily.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2018-06-12 12:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 12:23 [LTP] [PATCH] swapon: commit swapfile caches to disk Li Wang
2018-06-12 12:48 ` Cyril Hrubis [this message]
2018-06-12 13:05   ` Li Wang
2018-06-12 13:17     ` Li Wang
2018-06-12 12:56 ` Jan Stancek
2018-06-12 13:12   ` Li Wang
2018-06-14  6:37     ` Li Wang

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=20180612124822.GA18870@rei \
    --to=chrubis@suse.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox