Bug 451094 - Problems with scsi.agent and device type enclosure (0xd)
Summary: Problems with scsi.agent and device type enclosure (0xd)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: hotplug
Version: 4.6
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard: PM_RHEL4_8
Depends On:
Blocks: 391511 409961
TreeView+ depends on / blocked
 
Reported: 2008-06-12 18:59 UTC by Bryn M. Reeves
Modified: 2018-10-20 02:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-18 20:29:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Upstream patch to scsi.agent (375 bytes, patch)
2008-06-12 19:08 UTC, Bryn M. Reeves
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1006 0 normal SHIPPED_LIVE hotplug bug fix update 2009-05-18 14:09:46 UTC

Description Bryn M. Reeves 2008-06-12 18:59:10 UTC
Description of problem:
The scsi.agent script in /etc/hotplug contains a case statement that selects the
correct module to load for a variety of SCSI device types. The devices are
listed in the kernel header include/scsi/scsi.h:

/*
 *  DEVICE TYPES
 */

#define TYPE_DISK           0x00
#define TYPE_TAPE           0x01
#define TYPE_PRINTER        0x02
#define TYPE_PROCESSOR      0x03    /* HP scanners use this */
#define TYPE_WORM           0x04    /* Treated as ROM by our system */
#define TYPE_ROM            0x05
#define TYPE_SCANNER        0x06
#define TYPE_MOD            0x07    /* Magneto-optical disk - 
                                     * - treated as TYPE_DISK */
#define TYPE_MEDIUM_CHANGER 0x08
#define TYPE_COMM           0x09    /* Communications device */
#define TYPE_ENCLOSURE      0x0d    /* Enclosure Services Device */
#define TYPE_RAID           0x0c
#define TYPE_NO_LUN         0x7f

The script retrieves the type attribute from sysfs and uses this to select the
module to load:

    case "$TYPE" in
    # 2.5.51 style attributes; <scsi/scsi.h> TYPE_* constants
    0)          TYPE=disk ; MODULE=sd_mod ;;
    # FIXME some tapes use 'osst' not 'st'
    1)          TYPE=tape ; MODULE=st ;;
    2)          TYPE=printer ; MODULE=sg ;;
    3)          TYPE=processor ; MODULE=sg ;;
    4)          TYPE=worm ; MODULE=sr_mod ;;
    5)          TYPE=cdrom ; MODULE=sr_mod ;;
    6)          TYPE=scanner ; MODULE=sg ;;
    7)          TYPE=mod ; MODULE=sd_mod ;;
    8)          TYPE=changer ; MODULE=sg ;;
    9)          TYPE=comm ; MODULE=sg ;;
    14)         TYPE=enclosure ; MODULE=sg ;;
    esac

TYPE=enclosure should have the value 13 (0xd), not 14. This prevents the sg
module from being automatically loaded for this type of device.


Version-Release number of selected component (if applicable):
hotplug-2004_04_01-7.8

How reproducible:
100%

Steps to Reproduce:
1. Make sure the sg module is not loaded
2. Attach a SCSI device of type 0xd/13/enclosure
3. Run lsmod
  
Actual results:
The sg module is not automatically loaded

Expected results:
The sg module is automatically loaded as the script suggests it will

Additional info:
Upstream has made three changes in this area:

- correct constant for enclosure type
- add support for RBC and raid type devices
- change default module for RBC/enclosure to sd_mod

Index: etc/hotplug/scsi.agent
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/scsi.agent,v
retrieving revision 1.9
diff -u -r1.9 scsi.agent
--- etc/hotplug/scsi.agent	19 Jan 2005 17:42:46 -0000	1.9
+++ etc/hotplug/scsi.agent	13 Jul 2005 23:41:59 -0000
@@ -50,7 +50,9 @@
     7)		TYPE=mod ; MODULE=sd_mod ;;
     8)		TYPE=changer ;;
     9)		TYPE=comm ;;
-    14)		TYPE=enclosure ;;
+    12)		TYPE=raid ;;
+    13)		TYPE=enclosure ;;
+    14)		TYPE=rbc-disk ;  MODULE=sd_mod ;;
     esac
     if [ "$MODULE" != "" ]; then
 	mesg "$TYPE at $DEVPATH"

Comment 3 Bryn M. Reeves 2008-06-12 19:08:04 UTC
Created attachment 309132 [details]
Upstream patch to scsi.agent

Comment 8 Bill Nottingham 2009-01-23 16:36:13 UTC
Built as 3:2004_04_01-7.9.

Comment 9 Bill Nottingham 2009-01-23 17:48:49 UTC
Oops, make that -7.10.

Comment 13 Chris Ward 2009-03-27 14:19:24 UTC
~~ Attention Partners! Snap 1 Released ~~
RHEL 4.8 Snapshot 1 has been released on partners.redhat.com. There should
be a fix present, which addresses this bug. NOTE: there is only a short time
left to test, please test and report back results on this bug
at your earliest convenience.

If you encounter any issues, please set the bug back to the ASSIGNED state and
describe the issues you encountered. If you have found a NEW bug, clone this
bug and describe the issues you encountered. Further questions can be
directed to your Red Hat Partner Manager.

If you have VERIFIED the bug fix. Please select your PartnerID from the
Verified field above. Please leave a comment with your test results details.
Include which arches tested, package version and any applicable logs.

 - Red Hat QE Partner Management

Comment 16 errata-xmlrpc 2009-05-18 20:29:20 UTC
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 therefore 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/RHBA-2009-1006.html


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