All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: ltp@lists.linux.it
Cc: Richard Palethorpe <rpalethorpe@suse.com>
Subject: Re: [LTP] [PATCH] pidns12: Avoid write in sig handler
Date: Mon, 14 Nov 2022 11:34:22 +0000	[thread overview]
Message-ID: <87bkp9u5u8.fsf@suse.de> (raw)
In-Reply-To: <20221101112621.20031-1-rpalethorpe@suse.com>

Hello,

Richard Palethorpe <rpalethorpe@suse.com> writes:

> It is best to avoid doing any kind of unecessary work in a signal
> handler.

No review after 2 weeks. Merged!

>
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> Cc: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  testcases/kernel/containers/pidns/pidns12.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/containers/pidns/pidns12.c b/testcases/kernel/containers/pidns/pidns12.c
> index 65e2a0836..0e6b17142 100644
> --- a/testcases/kernel/containers/pidns/pidns12.c
> +++ b/testcases/kernel/containers/pidns/pidns12.c
> @@ -18,9 +18,11 @@
>  #include "tst_test.h"
>  #include "lapi/namespaces_constants.h"
>  
> +static volatile pid_t sig_pid = -1;
> +
>  static void child_signal_handler(LTP_ATTRIBUTE_UNUSED int sig, siginfo_t *si, LTP_ATTRIBUTE_UNUSED void *unused)
>  {
> -	TST_EXP_EQ_LI(si->si_pid, 0);
> +	sig_pid = si->si_pid;
>  }
>  
>  static int child_func(LTP_ATTRIBUTE_UNUSED void *arg)
> @@ -38,6 +40,8 @@ static int child_func(LTP_ATTRIBUTE_UNUSED void *arg)
>  
>  	TST_CHECKPOINT_WAKE_AND_WAIT(0);
>  
> +	TST_EXP_EQ_LI(sig_pid, 0);
> +
>  	return 0;
>  }


-- 
Thank you,
Richard.

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

      reply	other threads:[~2022-11-14 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01 11:26 [LTP] [PATCH] pidns12: Avoid write in sig handler Richard Palethorpe via ltp
2022-11-14 11:34 ` Richard Palethorpe [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=87bkp9u5u8.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=rpalethorpe@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.