From: Brian Maly <bmaly> Date: Wed, 13 Apr 2005 04:12:54 -0400 Subject: [RHEL3][PATCH] suppress medum-not-present messages from idefloppy) Tracking: 0957.bmaly.ide-floppy-no-media.patch Archives: 2005-April/msg00231.html Archives: 2005-April/msg00267.html Status: committed in -32.2.EL ------------------------------------------------------------------------ This patch prevents "media not present" messages, e.g. (ide-floppy: hde: I/O error, pc=0, key=2, asc=3a, ascq=0), from spewing to the console and logs when a floppy is absent from the ide-floppy drive. This generally spews to the console until it finally gives up. Certainly non critical, but an annoyance to some. [updated by bmaly on 14-Apr-2005] --- linux-2.4.21/drivers/ide/ide-floppy.c.orig +++ linux-2.4.21/drivers/ide/ide-floppy.c @@ -1026,6 +1026,20 @@ return ide_started; } +/** + * idefloppy_should_report_error() + * + * Supresses error messages resulting from Medium not present + */ +static inline int idefloppy_should_report_error(idefloppy_floppy_t *floppy) +{ + if (floppy->sense_key == 0x02 && + floppy->asc == 0x3a && + floppy->ascq == 0x00) + return 0; + return 1; +} + /* * Issue a packet command */ */ @@ -1058,12 +1072,13 @@ */ if (!test_bit(PC_ABORT, &pc->flags)) { if (!test_bit(PC_SUPPRESS_ERROR, &pc->flags)) { - printk(KERN_ERR "ide-floppy: %s: I/O error, " - "pc = %2x, key = %2x, " - "asc = %2x, ascq = %2x\n", - drive->name, pc->c[0], - floppy->sense_key, - floppy->asc, floppy->ascq); + if (idefloppy_should_report_error(floppy)) + printk(KERN_ERR "ide-floppy: %s: I/O error, " + "pc = %2x, key = %2x, " + "asc = %2x, ascq = %2x\n", + drive->name, pc->c[0], + floppy->sense_key, + floppy->asc, floppy->ascq); } /* Giving up */ pc->error = IDEFLOPPY_ERROR_GENERAL; @@ -1276,14 +1291,16 @@ #endif /* IDEFLOPPY_DEBUG_LOG */ if (rq->errors >= ERROR_MAX) { - if (floppy->failed_pc != NULL) - printk(KERN_ERR "ide-floppy: %s: I/O error, pc = %2x," - " key = %2x, asc = %2x, ascq = %2x\n", - drive->name, floppy->failed_pc->c[0], - floppy->sense_key, floppy->asc, floppy->ascq); + if (floppy->failed_pc != NULL) { + if (idefloppy_should_report_error(floppy)) + printk(KERN_ERR "ide-floppy: %s: I/O error, pc = %2x," + " key = %2x, asc = %2x, ascq = %2x\n", + drive->name, floppy->failed_pc->c[0], + floppy->sense_key, floppy->asc, floppy->ascq); + } else printk(KERN_ERR "ide-floppy: %s: I/O error\n", - drive->name); + drive->name); idefloppy_do_end_request(drive, 0); return ide_stopped; }
A fix for this problem was committed to the RHEL3 U6 patch pool on 22-Apr-2005 (in kernel version 2.4.21-32.2.EL).
*** Bug 160093 has been marked as a duplicate of this bug. ***
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2005-663.html