All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] flock07: Initialiaze the sigaction structure
@ 2025-02-05 10:19 Martin Doucha
  2025-02-05 10:24 ` Martin Doucha
  2025-02-05 10:53 ` Avinesh Kumar
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Doucha @ 2025-02-05 10:19 UTC (permalink / raw)
  To: ltp

The sigaction structure for child SIGUSR1 handler was uninitialized,
which sometimes resulted in SA_RESTART flag being enabled by accident
and the child flock() call never returning. Make sure the sigaction
structure is properly initialized.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/kernel/syscalls/flock/flock07.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/flock/flock07.c b/testcases/kernel/syscalls/flock/flock07.c
index 652fe3777..368147370 100644
--- a/testcases/kernel/syscalls/flock/flock07.c
+++ b/testcases/kernel/syscalls/flock/flock07.c
@@ -42,7 +42,7 @@ static void cleanup(void)
 
 static void child_do(int fd)
 {
-	struct sigaction sa;
+	struct sigaction sa = {};
 
 	sa.sa_handler = handler;
 	SAFE_SIGEMPTYSET(&sa.sa_mask);
-- 
2.47.0


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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] flock07: Initialiaze the sigaction structure
  2025-02-05 10:19 [LTP] [PATCH] flock07: Initialiaze the sigaction structure Martin Doucha
@ 2025-02-05 10:24 ` Martin Doucha
  2025-02-05 10:53 ` Avinesh Kumar
  1 sibling, 0 replies; 4+ messages in thread
From: Martin Doucha @ 2025-02-05 10:24 UTC (permalink / raw)
  To: ltp

Meh, I've made a typo in the commit message (subject) and didn't 
notice... Please fix the word "Initialize" before merge.

On 05. 02. 25 11:19, Martin Doucha wrote:
> The sigaction structure for child SIGUSR1 handler was uninitialized,
> which sometimes resulted in SA_RESTART flag being enabled by accident
> and the child flock() call never returning. Make sure the sigaction
> structure is properly initialized.
> 
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>   testcases/kernel/syscalls/flock/flock07.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/flock/flock07.c b/testcases/kernel/syscalls/flock/flock07.c
> index 652fe3777..368147370 100644
> --- a/testcases/kernel/syscalls/flock/flock07.c
> +++ b/testcases/kernel/syscalls/flock/flock07.c
> @@ -42,7 +42,7 @@ static void cleanup(void)
>   
>   static void child_do(int fd)
>   {
> -	struct sigaction sa;
> +	struct sigaction sa = {};
>   
>   	sa.sa_handler = handler;
>   	SAFE_SIGEMPTYSET(&sa.sa_mask);


-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] flock07: Initialiaze the sigaction structure
  2025-02-05 10:19 [LTP] [PATCH] flock07: Initialiaze the sigaction structure Martin Doucha
  2025-02-05 10:24 ` Martin Doucha
@ 2025-02-05 10:53 ` Avinesh Kumar
  2025-02-05 11:48   ` Andrea Cervesato via ltp
  1 sibling, 1 reply; 4+ messages in thread
From: Avinesh Kumar @ 2025-02-05 10:53 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi,

On Wednesday, February 5, 2025 11:19:36 AM CET Martin Doucha wrote:
> The sigaction structure for child SIGUSR1 handler was uninitialized,
> which sometimes resulted in SA_RESTART flag being enabled by accident
> and the child flock() call never returning. Make sure the sigaction
> structure is properly initialized.
> 
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>

Reviewed-by: Avinesh Kumar <akumar@suse.de>

Thanks,
Avinesh
> ---
>  testcases/kernel/syscalls/flock/flock07.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/flock/flock07.c b/testcases/kernel/syscalls/flock/flock07.c
> index 652fe3777..368147370 100644
> --- a/testcases/kernel/syscalls/flock/flock07.c
> +++ b/testcases/kernel/syscalls/flock/flock07.c
> @@ -42,7 +42,7 @@ static void cleanup(void)
>  
>  static void child_do(int fd)
>  {
> -	struct sigaction sa;
> +	struct sigaction sa = {};
>  
>  	sa.sa_handler = handler;
>  	SAFE_SIGEMPTYSET(&sa.sa_mask);
> 





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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] flock07: Initialiaze the sigaction structure
  2025-02-05 10:53 ` Avinesh Kumar
@ 2025-02-05 11:48   ` Andrea Cervesato via ltp
  0 siblings, 0 replies; 4+ messages in thread
From: Andrea Cervesato via ltp @ 2025-02-05 11:48 UTC (permalink / raw)
  To: Avinesh Kumar, Martin Doucha; +Cc: ltp

Hi!

Pushed, thanks.

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>

On 2/5/25 11:53, Avinesh Kumar wrote:
> Hi,
>
> On Wednesday, February 5, 2025 11:19:36 AM CET Martin Doucha wrote:
>> The sigaction structure for child SIGUSR1 handler was uninitialized,
>> which sometimes resulted in SA_RESTART flag being enabled by accident
>> and the child flock() call never returning. Make sure the sigaction
>> structure is properly initialized.
>>
>> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> Reviewed-by: Avinesh Kumar <akumar@suse.de>
>
> Thanks,
> Avinesh
>> ---
>>   testcases/kernel/syscalls/flock/flock07.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/testcases/kernel/syscalls/flock/flock07.c b/testcases/kernel/syscalls/flock/flock07.c
>> index 652fe3777..368147370 100644
>> --- a/testcases/kernel/syscalls/flock/flock07.c
>> +++ b/testcases/kernel/syscalls/flock/flock07.c
>> @@ -42,7 +42,7 @@ static void cleanup(void)
>>   
>>   static void child_do(int fd)
>>   {
>> -	struct sigaction sa;
>> +	struct sigaction sa = {};
>>   
>>   	sa.sa_handler = handler;
>>   	SAFE_SIGEMPTYSET(&sa.sa_mask);
>>
>
>
>
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-05 11:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05 10:19 [LTP] [PATCH] flock07: Initialiaze the sigaction structure Martin Doucha
2025-02-05 10:24 ` Martin Doucha
2025-02-05 10:53 ` Avinesh Kumar
2025-02-05 11:48   ` Andrea Cervesato via ltp

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.