From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752716AbbJFSch (ORCPT ); Tue, 6 Oct 2015 14:32:37 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:53741 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752574AbbJFScf (ORCPT ); Tue, 6 Oct 2015 14:32:35 -0400 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Tue, 6 Oct 2015 11:32:30 -0700 From: "Paul E. McKenney" To: Josh Triplett Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified Message-ID: <20151006183230.GP3910@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20151006164855.GA17055@linux.vnet.ibm.com> <1444150153-17463-1-git-send-email-paulmck@linux.vnet.ibm.com> <20151006173212.GG9600@cloud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151006173212.GG9600@cloud> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15100618-0021-0000-0000-00001370067F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2015 at 10:32:12AM -0700, Josh Triplett wrote: > 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 > > Signed-off-by: Paul E. McKenney > > Acked-by: David Miller > > 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. I was indeed a bit nervous about removing that comment, so thank you for checking up on it! (Can't be bothered to go back and figure out if it ever really was relevant...) Thanx, Paul > Reviewed-by: Josh Triplett > > > 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 > > >