From: Andi Kleen <ak@suse.de>
To: axboe@kernel.dk, linux-scsi@vger.kernel.org
Subject: [PATCH] Quieten down sg warnings with cdparanoia
Date: Wed, 8 Aug 2007 17:12:31 +0200 [thread overview]
Message-ID: <200708081712.31580.ak@suse.de> (raw)
Quieten down sg warnings
When using cdparanoia on SUSE 10.2 I get thousands of warnings.
While I'm sure the warning is something important that I just miss quieten it
down a bit to report only once for a program.
Signed-off-by: Andi Kleen <ak@suse.de>
Index: linux-2.6.23-rc1-misc/drivers/scsi/sg.c
===================================================================
--- linux-2.6.23-rc1-misc.orig/drivers/scsi/sg.c
+++ linux-2.6.23-rc1-misc/drivers/scsi/sg.c
@@ -605,8 +605,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 comm[sizeof(((struct task_struct *)0)->comm)];
+ if (printk_ratelimit() && strcmp(current->comm, comm)) {
printk(KERN_WARNING
"sg_write: data in/out %d/%d bytes for SCSI command 0x%x--"
"guessing data in;\n" KERN_WARNING " "
@@ -614,6 +615,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(comm, current->comm);
+ }
+ }
k = sg_common_write(sfp, srp, cmnd, sfp->timeout, blocking);
return (k < 0) ? k : count;
}
reply other threads:[~2007-08-08 15:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200708081712.31580.ak@suse.de \
--to=ak@suse.de \
--cc=axboe@kernel.dk \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.