All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] swapon04: Settle udev after mkswap to prevent tmpfs hole filling
Date: Thu, 12 Nov 2026 11:44:54 +0100	[thread overview]
Message-ID: <avWYppFIwRoUX-qk@yuki.lan> (raw)
In-Reply-To: <20261111081150.15101-1-wegao@suse.com>

Hi!
> diff --git a/testcases/kernel/syscalls/swapon/swapon04.c b/testcases/kernel/syscalls/swapon/swapon04.c
> index de95849e3..141456442 100644
> --- a/testcases/kernel/syscalls/swapon/swapon04.c
> +++ b/testcases/kernel/syscalls/swapon/swapon04.c
> @@ -138,6 +138,7 @@ static void verify_swapon(unsigned int n)
>  	struct stat st;
>  	blkcnt_t blocks_before, blocks_after;
>  	const char *const mkswap_argv[] = {"mkswap", loop_dev, NULL};
> +	const char *const udevadm_argv[] = {"udevadm", "settle", NULL};
>  
>  	tst_res(TINFO, "Testing swapon(%s, %s)", loop_dev, tc->desc);
>  
> @@ -148,6 +149,7 @@ static void verify_swapon(unsigned int n)
>  	SAFE_CLOSE(fd);
>  
>  	tst_cmd(mkswap_argv, "/dev/null", "/dev/null", 0);
> +	tst_cmd(udevadm_argv, "/dev/null", "/dev/null", TST_CMD_PASS_RETVAL);
>  
>  	SAFE_STAT(BACKING_FILE, &st);
>  	blocks_before = st.st_blocks;

The udevadm has to be added to .needs_cmds as well:

diff --git a/testcases/kernel/syscalls/swapon/swapon04.c b/testcases/kernel/syscalls/swapon/swapon04.c
index de95849e3..15a7c1063 100644
--- a/testcases/kernel/syscalls/swapon/swapon04.c
+++ b/testcases/kernel/syscalls/swapon/swapon04.c
@@ -195,6 +195,7 @@ static struct tst_test test = {
        },
        .needs_cmds = (struct tst_cmd[]) {
                {.cmd = "mkswap"},
+               {.cmd = "udevadm"},
                {}
        },
        .needs_kconfigs = (const char *[]) {


-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2026-11-12 10:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  8:09 [LTP] [PATCH v1] swapon04: Settle udev after mkswap to prevent tmpfs hole filling Wei Gao via ltp
2026-11-11  8:30 ` [LTP] " linuxtestproject.agent
2026-11-12 10:44 ` Cyril Hrubis [this message]
2026-11-12 10:49 ` [LTP] [PATCH v1] " Cyril Hrubis
2026-11-13  3:08 ` [LTP] [PATCH v2] swapon04: Settle udev after mkswap on kernels < 5.18 Wei Gao via ltp

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=avWYppFIwRoUX-qk@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.