All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Ricardo Branco <rbranco@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] userfaultfd: Minor fixes
Date: Wed, 25 Mar 2026 10:23:13 +0100	[thread overview]
Message-ID: <20260325092313.GA97750@pevik> (raw)
In-Reply-To: <20260320170058.433730-1-rbranco@suse.de>

Hi Ricardo,

...
> +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c
> @@ -53,11 +53,14 @@ static void set_pages(void)

>  static void reset_pages(void)
>  {
> -	SAFE_MUNMAP(page, page_size);
> -	SAFE_MUNMAP(copy_page, page_size);
> +	if (page) {
> +		SAFE_MUNMAP(page, page_size);
> +		SAFE_MUNMAP(copy_page, page_size);
> +		page = NULL;
> +	}
>  }

> -static void *handle_thread(void)
> +static void *handle_thread(void *arg LTP_ATTRIBUTE_UNUSED)
>  {
>  	static struct uffd_msg msg;
>  	struct uffdio_copy uffdio_copy = {};
> @@ -129,4 +132,5 @@ static struct tst_test test = {
>  	.setup = setup,
>  	.test = run,
>  	.tcnt = ARRAY_SIZE(tcases),
> +	.cleanup = reset_pages,
>  };
> diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd02.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd02.c
> index 2fd5ba5d8..db9ce4da4 100644
> --- a/testcases/kernel/syscalls/userfaultfd/userfaultfd02.c
> +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd02.c
> @@ -32,11 +32,13 @@ static void set_pages(void)

>  static void reset_pages(void)
>  {
> -	SAFE_MUNMAP(page, page_size);
> -	SAFE_MUNMAP(move_page, page_size);
> +	if (page) {
> +		SAFE_MUNMAP(page, page_size);
> +		SAFE_MUNMAP(move_page, page_size);
Here should be also page = NULL; right?

With that (can be added before merge)
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> +	}
>  }
...

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

      reply	other threads:[~2026-03-25  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 17:00 [LTP] [PATCH] userfaultfd: Minor fixes Ricardo Branco
2026-03-25  9:23 ` Petr Vorel [this message]

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=20260325092313.GA97750@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=rbranco@suse.de \
    /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.