rate-limit libata-scsi status/error message
PATCH 1/1 rate-limit libata-scsi status/error message
From: Randy Dunlap <[email protected]>
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.
--- drivers/scsi/libata-scsi.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/scsi/libata-scsi.c +4 -3
@@ -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 ; }
---
Quoted 5 lines · Randy.Dunlap
From: Randy Dunlap <[email protected]>
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.
...
drivers/scsi/libata-scsi.c void ata_to_sense_error(unsigned id, u8 · line 526
Quoted 7 lines
drivers/scsi/libata-scsi.c +4
-3-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
Quoted 19 lines · Mark Lord
Quoted 5 lines · Randy.Dunlap
From: Randy Dunlap <[email protected]>
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.
...
drivers/scsi/libata-scsi.c void ata_to_sense_error(unsigned id, u8 · line 526
Quoted 7 lines
drivers/scsi/libata-scsi.c +4
-3-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);
Quoted 2 lines
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