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"
Created attachment 309132 [details] Upstream patch to scsi.agent
Built as 3:2004_04_01-7.9.
Oops, make that -7.10.
~~ 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
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