[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151006173212.GG9600@cloud>
Date: Tue, 6 Oct 2015 10:32:12 -0700
From: Josh Triplett <josh@...htriplett.org>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org,
jiangshanlai@...il.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
tglx@...utronix.de, peterz@...radead.org, rostedt@...dmis.org,
dhowells@...hat.com, edumazet@...gle.com, dvhart@...ux.intel.com,
fweisbec@...il.com, oleg@...hat.com, bobby.prani@...il.com
Subject: Re: [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad
torture_type specified
On Tue, Oct 06, 2015 at 09:49:10AM -0700, Paul E. McKenney wrote:
> The rcutorture module has a list of torture types, and specifying a
> type not on this list is supposed to cleanly fail the module load.
> Unfortunately, the "fail" happens without the "cleanly". This commit
> therefore adds the needed clean-up after an incorrect torture_type.
>
> Reported-by: David Miller <davem@...emloft.net>
> Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> Acked-by: David Miller <davem@...emloft.net>
After a careful review of rcu_torture_cleanup and the cur_ops->init()
functions to verify that the dire comment about not using "goto unwind"
doesn't actually apply (rcu_torture_cleanup *seems* to handle lack of
init), this seems fine.
Reviewed-by: Josh Triplett <josh@...htriplett.org>
> kernel/rcu/rcutorture.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index 77192953dee5..b74b56474e17 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -1742,15 +1742,15 @@ rcu_torture_init(void)
> for (i = 0; i < ARRAY_SIZE(torture_ops); i++)
> pr_alert(" %s", torture_ops[i]->name);
> pr_alert("\n");
> - torture_init_end();
> - return -EINVAL;
> + firsterr = -EINVAL;
> + goto unwind;
> }
> if (cur_ops->fqs == NULL && fqs_duration != 0) {
> pr_alert("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n");
> fqs_duration = 0;
> }
> if (cur_ops->init)
> - cur_ops->init(); /* no "goto unwind" prior to this point!!! */
> + cur_ops->init();
>
> if (nreaders >= 0) {
> nrealreaders = nreaders;
> --
> 2.5.2
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists