* [PATCH] selftests/futex: Correct pthread_create return value check
@ 2026-07-27 3:08 Lei Zhu
2026-08-03 14:54 ` André Almeida
2026-08-10 14:32 ` Thomas Gleixner
0 siblings, 2 replies; 3+ messages in thread
From: Lei Zhu @ 2026-07-27 3:08 UTC (permalink / raw)
To: tglx, mingo, peterz, dvhart, dave, andrealmeid, shuah
Cc: linux-kernel, linux-kselftest, zhulei_szu
From: Lei Zhu <zhulei@kylinos.cn>
The pthread_create() functions returns 0 on success and a positive value on
failure. Modify the return value check to correctly detect failure cases.
Fixes: 14d016bd7282 ("selftests/futex: Refactor futex_wait_private_mapped_file with kselftest_harness.h")
Signed-off-by: Lei Zhu <zhulei@kylinos.cn>
---
.../selftests/futex/functional/futex_wait_private_mapped_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c b/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
index 2a749f9b14eb..e6266c8a357e 100644
--- a/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
+++ b/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
@@ -62,7 +62,7 @@ TEST(wait_private_mapped_file)
int res;
res = pthread_create(&thr, NULL, thr_futex_wait, NULL);
- if (res < 0)
+ if (res)
ksft_exit_fail_msg("pthread_create error\n");
ksft_print_dbg_msg("wait a while\n");
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/futex: Correct pthread_create return value check
2026-07-27 3:08 [PATCH] selftests/futex: Correct pthread_create return value check Lei Zhu
@ 2026-08-03 14:54 ` André Almeida
2026-08-10 14:32 ` Thomas Gleixner
1 sibling, 0 replies; 3+ messages in thread
From: André Almeida @ 2026-08-03 14:54 UTC (permalink / raw)
To: Lei Zhu
Cc: linux-kernel, mingo, linux-kselftest, peterz, tglx, dvhart, shuah,
dave
Em 27/07/2026 00:08, Lei Zhu escreveu:
> From: Lei Zhu <zhulei@kylinos.cn>
>
> The pthread_create() functions returns 0 on success and a positive value on
> failure. Modify the return value check to correctly detect failure cases.
>
> Fixes: 14d016bd7282 ("selftests/futex: Refactor futex_wait_private_mapped_file with kselftest_harness.h")
> Signed-off-by: Lei Zhu <zhulei@kylinos.cn>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/futex: Correct pthread_create return value check
2026-07-27 3:08 [PATCH] selftests/futex: Correct pthread_create return value check Lei Zhu
2026-08-03 14:54 ` André Almeida
@ 2026-08-10 14:32 ` Thomas Gleixner
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2026-08-10 14:32 UTC (permalink / raw)
To: Lei Zhu, mingo, peterz, dvhart, dave, andrealmeid, shuah
Cc: linux-kernel, linux-kselftest, zhulei_szu
On Mon, Jul 27 2026 at 11:08, Lei Zhu wrote:
> From: Lei Zhu <zhulei@kylinos.cn>
>
> The pthread_create() functions returns 0 on success and a positive value on
> failure. Modify the return value check to correctly detect failure cases.
>
> Fixes: 14d016bd7282 ("selftests/futex: Refactor futex_wait_private_mapped_file with kselftest_harness.h")
> Signed-off-by: Lei Zhu <zhulei@kylinos.cn>
> ---
> .../selftests/futex/functional/futex_wait_private_mapped_file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c b/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
> index 2a749f9b14eb..e6266c8a357e 100644
> --- a/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
> +++ b/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
> @@ -62,7 +62,7 @@ TEST(wait_private_mapped_file)
> int res;
>
> res = pthread_create(&thr, NULL, thr_futex_wait, NULL);
> - if (res < 0)
> + if (res)
> ksft_exit_fail_msg("pthread_create error\n");
That does not apply on the locking/futex branch of the tip tree. It's
fixed already.
Thanks,
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-10 14:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27 3:08 [PATCH] selftests/futex: Correct pthread_create return value check Lei Zhu
2026-08-03 14:54 ` André Almeida
2026-08-10 14:32 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox