login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
January
»
15
Re: [PATCH] Only print SCSI data direction warning once for a command
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Douglas Gilbert <dougg@...>
To: Andi Kleen <ak@...>
Cc: James Bottomley <James.Bottomley@...>, <linux-scsi@...>, <linux-kernel@...>
Subject:
Re: [PATCH] Only print SCSI data direction warning once for a command
Date: Tuesday, January 15, 2008 - 1:02 am
Andi Kleen wrote:
quoted text
>> to the log because they come from printk_ratelimit(). So all you've >> done is halved the volume of flow to the logs and left a dangling printk >> suppressed message that keeps spewing, so I don't think the patch even >> does what you describe it as doing ... if you reverse the order of the >> operands in the if() it will ... > > Here's an updated patch with the reversed order. > > -Andi > > --- > > Only print SCSI data direction warning once for a command v2 > > When I use cdparanoia my logs get spammed a lot by > > printk: 464 messages suppressed. > sg_write: data in/out 30576/30576 bytes for SCSI command 0xbe--guessing data in; > program cdparanoia not setting count and/or reply_len properly > printk: 1078 messages suppressed. > > and many more of those. With this patch the message is only printed once > for a command in a row. > > v1->v2: Prevent rate limit messages too (pointed out by jejb) > > Signed-off-by: Andi Kleen <ak@suse.de> > > --- > drivers/scsi/sg.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > Index: linux/drivers/scsi/sg.c > =================================================================== > --- linux.orig/drivers/scsi/sg.c > +++ linux/drivers/scsi/sg.c > @@ -602,8 +602,9 @@ sg_write(struct file *filp, const char _ > * but is is possible that the app intended SG_DXFER_TO_DEV, because there > * is a non-zero input_size, so emit a warning. > */ > - if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) > - if (printk_ratelimit()) > + if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) { > + static char cmd[TASK_COMM_LEN]; > + if (strcmp(current->comm, cmd) && printk_ratelimit()) { > printk(KERN_WARNING > "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--" > "guessing data in;\n" KERN_WARNING " " > @@ -611,6 +612,9 @@ sg_write(struct file *filp, const char _ > old_hdr.reply_len - (int)SZ_SG_HEADER, > input_size, (unsigned int) cmnd[0], > current->comm); > + strcpy(cmd, current->comm); > + } > + } > k = sg_common_write(sfp, srp, cmnd, sfp->timeout, blocking); > return (k < 0) ? k : count; > } > >
Signed-off-by: Douglas Gilbert <dougg@torque.net> --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] Only print SCSI data direction warning once for a co...
, Andi Kleen
, (Wed Jan 2, 2:03 am)
Re: [PATCH] Only print SCSI data direction warning once for ...
, James Bottomley
, (Sat Jan 12, 3:36 pm)
Re: [PATCH] Only print SCSI data direction warning once for ...
, Andi Kleen
, (Sun Jan 13, 12:41 pm)
Re: [PATCH] Only print SCSI data direction warning once for ...
, Douglas Gilbert
, (Tue Jan 15, 1:02 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
Andrew Morton
2.6.25-mm1
david
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Bart Van Assche
Integration of SCST in the mainstream Linux kernel
git
:
linux-netdev
:
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 15/37] dccp: Set per-connection CCIDs via socket options
David Miller
[GIT]: Networking
Natalie Protasevich
[BUG] New Kernel Bugs
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
509 guests
online.
Online users
strcmp
Syndicate