lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110223163106.GM2163@linux.vnet.ibm.com>
Date:	Wed, 23 Feb 2011 08:31:06 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...ymtl.ca,
	josh@...htriplett.org, niv@...ibm.com, tglx@...utronix.de,
	peterz@...radead.org, rostedt@...dmis.org, Valdis.Kletnieks@...edu,
	dhowells@...hat.com, eric.dumazet@...il.com, darren@...art.com,
	"Paul E. McKenney" <paul.mckenney@...aro.org>
Subject: Re: [PATCH RFC tip/core/rcu 14/14] rcu: Add boosting to
 TREE_PREEMPT_RCU tracing

On Wed, Feb 23, 2011 at 11:07:20AM +0800, Lai Jiangshan wrote:
> On 02/23/2011 09:39 AM, Paul E. McKenney wrote:
> >  	rcudir = debugfs_create_dir("rcu", NULL);
> > -	if (!rcudir)
> > +	if (IS_ERR_VALUE(rcudir))
> >  		goto free_out;
> 
> if !defined(CONFIG_DEBUG_FS)
> 	debugfs_create_xxx() returns ERR_PTR(-ENODEV);
> else
> 	debugfs_create_xxx() returns NULL when failed.
> 
> Since TREE_RCU_TRACE selects DEBUG_FS, "if (!rcudir)" is correct,
> we don't need to change it.

Yeah, but this really needs to be less fragile.  And yes, I do appear
to have broken it in the NULL-pointer case.  And who came up with the
API above, anyway?  It is an accident waiting to happen.

All whining aside, I need something like the following, correct?

#define IS_ERR_VALUE_OR_NULL(x) \
	unlikely((x) - 1 >= (unsigned long)(-MAX_ERRNO-1)

							Thanx, Paul

> >  	retval = debugfs_create_file("rcudata", 0444, rcudir,
> >  						NULL, &rcudata_fops);
> > -	if (!retval)
> > +	if (IS_ERR_VALUE(retval))
> >  		goto free_out;
> >  
> >  	retval = debugfs_create_file("rcudata.csv", 0444, rcudir,
> >  						NULL, &rcudata_csv_fops);
> > -	if (!retval)
> > +	if (IS_ERR_VALUE(retval))
> > +		goto free_out;
> > +
> > +	retval = rcu_boost_trace_create_file(rcudir);
> > +	if (retval)
> >  		goto free_out;
> >  
> >  	retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops);
> > -	if (!retval)
> > +	if (IS_ERR_VALUE(retval))
> >  		goto free_out;
> >  
> >  	retval = debugfs_create_file("rcuhier", 0444, rcudir,
> >  						NULL, &rcuhier_fops);
> > -	if (!retval)
> > +	if (IS_ERR_VALUE(retval))
> >  		goto free_out;
> >  
> >  	retval = debugfs_create_file("rcu_pending", 0444, rcudir,
> >  						NULL, &rcu_pending_fops);
> > -	if (!retval)
> > +	if (IS_ERR_VALUE(retval))
> >  		goto free_out;
> >  	return 0;
> >  free_out:
> 
> --
> 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/
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ