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: <20140512202657.43eca18f8add0ba43a4564ab@skynet.be>
Date:	Mon, 12 May 2014 20:26:57 +0200
From:	Fabian Frederick <fabf@...net.be>
To:	Joe Perches <joe@...ches.com>
Cc:	Tejun Heo <tj@...nel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	akpm <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn &
 printk/pr_info

On Mon, 12 May 2014 11:21:28 -0700
Joe Perches <joe@...ches.com> wrote:

> On Mon, 2014-05-12 at 19:56 +0200, Fabian Frederick wrote:
> > Cc: Tejun Heo <tj@...nel.org>
> > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > Signed-off-by: Fabian Frederick <fabf@...net.be>
> > ---
> >  kernel/workqueue.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> > index 0ee63af..6824afc 100644
> > --- a/kernel/workqueue.c
> > +++ b/kernel/workqueue.c
> > @@ -4098,8 +4098,8 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu,
> >  	/* create a new pwq */
> >  	pwq = alloc_unbound_pwq(wq, target_attrs);
> >  	if (!pwq) {
> > -		pr_warning("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
> > -			   wq->name);
> > +		pr_warn("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
> > +			wq->name);
> >  		goto out_unlock;
> >  	}
> >  
> > @@ -4548,7 +4548,7 @@ void print_worker_info(const char *log_lvl, struct task_struct *task)
> >  		probe_kernel_read(desc, worker->desc, sizeof(desc) - 1);
> >  
> >  	if (fn || name[0] || desc[0]) {
> > -		printk("%sWorkqueue: %s %pf", log_lvl, name, fn);
> > +		pr_info("%sWorkqueue: %s %pf", log_lvl, name, fn);
> 
> Not correct.
> 
> log_lvl already emits the appropriate level
> and this overrides it with KERN_INFO.
> 
> The output will now be incorrect emitting
> at KERN_INFO followed by an SOH and the
> desired log level.
Such printk can't be converted to pr_ ?

> 
> >  		if (desc[0])
> >  			pr_cont(" (%s)", desc);
> >  		pr_cont("\n");
> 
> Trivially, it likely would be a bit better to avoid
> any possible output message interleaving by using:
> 
> 	if (fn || name[0] || desc[0]) {
> 		if (desc[0])
> 			printk("%sWorkqueue: %s %pf (%s)\n",
> 			       log_lvl, name, fn, desc);
> 		else
> 			printk("%sWorkqueue: %s %pf\n",
> 			       log_lvl, name, fn);
> 	}
> 
> 
> 


-- 
Fabian Frederick <fabf@...net.be>
--
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