Bug 159989 - [RHEL3][PATCH] suppress medum-not-present messages from idefloppy
[RHEL3][PATCH] suppress medum-not-present messages from idefloppy
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Brian Maly
Brian Brock
:
Depends On:
Blocks: 156320
  Show dependency treegraph
 
Reported: 2005-06-09 17:58 EDT by Tim Burke
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHSA-2005-663
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-28 11:20:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tim Burke 2005-06-09 17:58:06 EDT
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;
        }
Comment 2 Ernie Petrides 2005-06-10 00:01:30 EDT
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).
Comment 3 Ernie Petrides 2005-06-10 15:56:02 EDT
*** Bug 160093 has been marked as a duplicate of this bug. ***
Comment 9 Red Hat Bugzilla 2005-09-28 11:20:16 EDT
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

Note You need to log in before you can comment on or make changes to this bug.