linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/futex: Fix futex_cmp_requeue_pi() error handling
@ 2015-07-20 22:48 Darren Hart
  2015-07-21  0:34 ` Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Darren Hart @ 2015-07-20 22:48 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Shuah Khan, David Binderman, Linux API Mailing List

An earlier (pre-kernel-integration) refactoring of this code mistakenly
replaced the error condition, <, with a >. Use < to detect an error as
opposed to a successful requeue or signal race.

Reported-by: David Binderman <dcb314-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
Cc: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
Signed-off-by: Darren Hart <dvhart-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 .../selftests/futex/functional/futex_requeue_pi_signal_restart.c        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c b/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
index 7f0c756..3d7dc6a 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
 		if (res > 0) {
 			atomic_set(&requeued, 1);
 			break;
-		} else if (res > 0) {
+		} else if (res < 0) {
 			error("FUTEX_CMP_REQUEUE_PI failed\n", errno);
 			ret = RET_ERROR;
 			break;
-- 
2.1.4


-- 
Darren Hart
Intel Open Source Technology Center

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

* Re: [PATCH] selftests/futex: Fix futex_cmp_requeue_pi() error handling
  2015-07-20 22:48 [PATCH] selftests/futex: Fix futex_cmp_requeue_pi() error handling Darren Hart
@ 2015-07-21  0:34 ` Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2015-07-21  0:34 UTC (permalink / raw)
  To: Darren Hart, Linux Kernel Mailing List
  Cc: David Binderman, Linux API Mailing List

On 07/20/2015 04:48 PM, Darren Hart wrote:
> An earlier (pre-kernel-integration) refactoring of this code mistakenly
> replaced the error condition, <, with a >. Use < to detect an error as
> opposed to a successful requeue or signal race.
> 
> Reported-by: David Binderman <dcb314@hotmail.com>
> Cc: Shuah Khan <shuahkh@osg.samsung.com>
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> ---
>  .../selftests/futex/functional/futex_requeue_pi_signal_restart.c        | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c b/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
> index 7f0c756..3d7dc6a 100644
> --- a/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
> +++ b/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
> @@ -191,7 +191,7 @@ int main(int argc, char *argv[])
>  		if (res > 0) {
>  			atomic_set(&requeued, 1);
>  			break;
> -		} else if (res > 0) {
> +		} else if (res < 0) {
>  			error("FUTEX_CMP_REQUEUE_PI failed\n", errno);
>  			ret = RET_ERROR;
>  			break;
> 

Daren,

That is quick. Applied to linux-kselftest fixes for 4.2

thanks,
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

end of thread, other threads:[~2015-07-21  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-20 22:48 [PATCH] selftests/futex: Fix futex_cmp_requeue_pi() error handling Darren Hart
2015-07-21  0:34 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).