linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rcutorture: Fix error codes in rcu_torture_read_exit_init()
@ 2020-04-29 13:22 Dan Carpenter
  2020-04-29 15:53 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-04-29 13:22 UTC (permalink / raw)
  To: Davidlohr Bueso
  Cc: Paul E. McKenney, Josh Triplett, Steven Rostedt,
	Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes, linux-kernel,
	rcu, kernel-janitors

The rcu_torture_read_exit_init() function is supposed to return negative
error codes which get propagated back down the call tree but the current
code returns true on failure.

Fixes: e02882cd57e3 ("rcutorture: Add races with task-exit processing")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 kernel/rcu/rcutorture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 269881e51dc6d..5270674128029 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -2434,10 +2434,10 @@ static int rcu_torture_read_exit(void *unused)
 	return 0;
 }
 
-static bool rcu_torture_read_exit_init(void)
+static int rcu_torture_read_exit_init(void)
 {
 	if (read_exit <= 0)
-		return true;
+		return -EINVAL;
 	init_waitqueue_head(&read_exit_wq);
 	read_exit_child_stop = false;
 	read_exit_child_stopped = false;
-- 
2.26.2


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

* Re: [PATCH] rcutorture: Fix error codes in rcu_torture_read_exit_init()
  2020-04-29 13:22 [PATCH] rcutorture: Fix error codes in rcu_torture_read_exit_init() Dan Carpenter
@ 2020-04-29 15:53 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2020-04-29 15:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Davidlohr Bueso, Josh Triplett, Steven Rostedt,
	Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes, linux-kernel,
	rcu, kernel-janitors

On Wed, Apr 29, 2020 at 04:22:35PM +0300, Dan Carpenter wrote:
> The rcu_torture_read_exit_init() function is supposed to return negative
> error codes which get propagated back down the call tree but the current
> code returns true on failure.
> 
> Fixes: e02882cd57e3 ("rcutorture: Add races with task-exit processing")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Good catch!  Talk about code sort of working by accident!!!

Thank you, and I folded this into the original commit with attribution.

						Thanx, Paul

> ---
>  kernel/rcu/rcutorture.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index 269881e51dc6d..5270674128029 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -2434,10 +2434,10 @@ static int rcu_torture_read_exit(void *unused)
>  	return 0;
>  }
>  
> -static bool rcu_torture_read_exit_init(void)
> +static int rcu_torture_read_exit_init(void)
>  {
>  	if (read_exit <= 0)
> -		return true;
> +		return -EINVAL;
>  	init_waitqueue_head(&read_exit_wq);
>  	read_exit_child_stop = false;
>  	read_exit_child_stopped = false;
> -- 
> 2.26.2
> 

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

end of thread, other threads:[~2020-04-29 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 13:22 [PATCH] rcutorture: Fix error codes in rcu_torture_read_exit_init() Dan Carpenter
2020-04-29 15:53 ` Paul E. McKenney

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).