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: <1327422950.5400.40.camel@deadeye>
Date:	Tue, 24 Jan 2012 16:35:50 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Phil Carmody <ext-phil.2.carmody@...ia.com>
Cc:	ext Greg KH <gregkh@...e.de>, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org, torvalds@...ux-foundation.org,
	akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
	Paolo Bonzini <pbonzini@...hat.com>,
	Petr Matousek <pmatouse@...hat.com>,
	linux-scsi@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
	James Bottomley <JBottomley@...allels>
Subject: Re: [23/27] kernel.h: add printk_ratelimited and pr_<level>_rl

On Tue, 2012-01-24 at 16:46 +0200, Phil Carmody wrote:
> On 23/01/12 15:41 -0800, ext Greg KH wrote:
> > 2.6.32-longterm review patch.  If anyone has any objections, please let me know.
> 
> This looks like an added feature with no users in .32 - does it really 
> belong in a stable tree?
> (But to be explicit, I have no issue with its contents at all.)

It's required for commit 0bfc96cb77224736dfa35c3c555d37b3646ef35e
('block: fail SCSI passthrough ioctls on partition devices'), though
that hasn't actually been included in this series.  I think that's
because there is still ongoing discussion of which error codes need to
be used.

Ben.

> Phil
> 
> > ------------------
> > 
> > 
> > From: Joe Perches <joe@...ches.com>
> > 
> > commit 8a64f336bc1d4aa203b138d29d5a9c414a9fbb47 upstream.
> > 
> > Add a printk_ratelimited statement expression macro that uses a per-call
> > ratelimit_state so that multiple subsystems output messages are not
> > suppressed by a global __ratelimit state.
> > 
> > [akpm@...ux-foundation.org: coding-style fixes]
> > [akpm@...ux-foundation.org: s/_rl/_ratelimited/g]
> > Signed-off-by: Joe Perches <joe@...ches.com>
> > Cc: Naohiro Ooiwa <nooiwa@...aclelinux.com>
> > Cc: Ingo Molnar <mingo@...e.hu>
> > Cc: Hiroshi Shimamoto <h-shimamoto@...jp.nec.com>
> > Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> > Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> > Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
> > 
> > ---
> >  include/linux/kernel.h |   44 ++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 44 insertions(+)
> > 
> > --- a/include/linux/kernel.h
> > +++ b/include/linux/kernel.h
> > @@ -407,6 +407,50 @@ static inline char *pack_hex_byte(char *
> >  #endif
> >  
> >  /*
> > + * ratelimited messages with local ratelimit_state,
> > + * no local ratelimit_state used in the !PRINTK case
> > + */
> > +#ifdef CONFIG_PRINTK
> > +#define printk_ratelimited(fmt, ...)  ({		\
> > +	static struct ratelimit_state _rs = {		\
> > +		.interval = DEFAULT_RATELIMIT_INTERVAL, \
> > +		.burst = DEFAULT_RATELIMIT_BURST,       \
> > +	};                                              \
> > +							\
> > +	if (!__ratelimit(&_rs))                         \
> > +		printk(fmt, ##__VA_ARGS__);		\
> > +})
> > +#else
> > +/* No effect, but we still get type checking even in the !PRINTK case: */
> > +#define printk_ratelimited printk
> > +#endif
> > +
> > +#define pr_emerg_ratelimited(fmt, ...) \
> > +	printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
> > +#define pr_alert_ratelimited(fmt, ...) \
> > +	printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
> > +#define pr_crit_ratelimited(fmt, ...) \
> > +	printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
> > +#define pr_err_ratelimited(fmt, ...) \
> > +	printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
> > +#define pr_warning_ratelimited(fmt, ...) \
> > +	printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
> > +#define pr_notice_ratelimited(fmt, ...) \
> > +	printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
> > +#define pr_info_ratelimited(fmt, ...) \
> > +	printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
> > +/* no pr_cont_ratelimited, don't do that... */
> > +/* If you are writing a driver, please use dev_dbg instead */
> > +#if defined(DEBUG)
> > +#define pr_debug_ratelimited(fmt, ...) \
> > +	printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> > +#else
> > +#define pr_debug_ratelimited(fmt, ...) \
> > +	({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \
> > +				     ##__VA_ARGS__); 0; })
> > +#endif
> > +
> > +/*
> >   * General tracing related utility functions - trace_printk(),
> >   * tracing_on/tracing_off and tracing_start()/tracing_stop
> >   *
> > 
> > 
> > --
> > 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 stable" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Ben Hutchings
Horngren's Observation:
                   Among economists, the real world is often a special case.

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ