linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rate-limit libata-scsi status/error message
@ 2006-02-18  5:37 Randy.Dunlap
  2006-02-18 14:13 ` Mark Lord
  0 siblings, 1 reply; 3+ messages in thread
From: Randy.Dunlap @ 2006-02-18  5:37 UTC (permalink / raw)
  To: ide; +Cc: jgarzik

From: Randy Dunlap <rdunlap@xenotime.net>

Rate-limit a translated ATA status/error message.
I have a kernel log that is 2/3 full of these messages
due to a CD/DVD drive being empty.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
 drivers/scsi/libata-scsi.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

--- linux-2616-rc4.orig/drivers/scsi/libata-scsi.c
+++ linux-2616-rc4/drivers/scsi/libata-scsi.c
@@ -520,9 +520,10 @@ void ata_to_sense_error(unsigned id, u8 
 	*ascq = 0x04; /*  "auto-reallocation failed" */
 
  translate_done:
-	printk(KERN_ERR "ata%u: translated ATA stat/err 0x%02x/%02x to "
-	       "SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n", id, drv_stat, drv_err,
-	       *sk, *asc, *ascq);
+	if (printk_ratelimit())
+		printk(KERN_ERR "ata%u: translated ATA stat/err 0x%02x/%02x to "
+			"SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n",
+			id, drv_stat, drv_err, *sk, *asc, *ascq);
 	return;
 }
 


---

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rate-limit libata-scsi status/error message
  2006-02-18  5:37 [PATCH] rate-limit libata-scsi status/error message Randy.Dunlap
@ 2006-02-18 14:13 ` Mark Lord
  2006-03-01 20:43   ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Lord @ 2006-02-18 14:13 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: ide, jgarzik

Randy.Dunlap wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
> 
> Rate-limit a translated ATA status/error message.
> I have a kernel log that is 2/3 full of these messages
> due to a CD/DVD drive being empty.
...
> -	printk(KERN_ERR "ata%u: translated ATA stat/err 0x%02x/%02x to "
> -	       "SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n", id, drv_stat, drv_err,
> -	       *sk, *asc, *ascq);
> +	if (printk_ratelimit())
> +		printk(KERN_ERR "ata%u: translated ATA stat/err 0x%02x/%02x to "
> +			"SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n",
> +			id, drv_stat, drv_err, *sk, *asc, *ascq);

That message shouldn't even be enabled for non DEBUG cases.
I suspect Jeff will remove it for 2.6.17..

-ml

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rate-limit libata-scsi status/error message
  2006-02-18 14:13 ` Mark Lord
@ 2006-03-01 20:43   ` Jeff Garzik
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2006-03-01 20:43 UTC (permalink / raw)
  To: Mark Lord; +Cc: Randy.Dunlap, ide

Mark Lord wrote:
> Randy.Dunlap wrote:
> 
>> From: Randy Dunlap <rdunlap@xenotime.net>
>>
>> Rate-limit a translated ATA status/error message.
>> I have a kernel log that is 2/3 full of these messages
>> due to a CD/DVD drive being empty.
> 
> ...
> 
>> -    printk(KERN_ERR "ata%u: translated ATA stat/err 0x%02x/%02x to "
>> -           "SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n", id, drv_stat, drv_err,
>> -           *sk, *asc, *ascq);
>> +    if (printk_ratelimit())
>> +        printk(KERN_ERR "ata%u: translated ATA stat/err 0x%02x/%02x to "
>> +            "SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n",
>> +            id, drv_stat, drv_err, *sk, *asc, *ascq);
> 
> 
> That message shouldn't even be enabled for non DEBUG cases.
> I suspect Jeff will remove it for 2.6.17..

Kinda sorta:  ATAPI errors are still shaking out, in a big way.  Under 
ATA, almost any error should be reported.  Under ATAPI, certain classes 
of errors are quite normal, and should not fill the logs with spam.

The proper fix is to avoid reporting errors for those few ATAPI cases 
that occur in normal operation, rather than ratelimiting all libata 
error messages.

IOW don't report an error, when it isn't really an error...

	Jeff




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-01 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-18  5:37 [PATCH] rate-limit libata-scsi status/error message Randy.Dunlap
2006-02-18 14:13 ` Mark Lord
2006-03-01 20:43   ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).