Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 515566

Summary: cciss disk devices have empty block.device property in HAL
Product: Red Hat Enterprise Linux 5 Reporter: Alan Pevec <apevec>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED ERRATA QA Contact: Karel Volný <kvolny>
Severity: medium Docs Contact:
Priority: urgent    
Version: 5.4CC: apevec, berrange, bzeranski, cmeadors, coughlan, harald, jkoten, jplans, jwest, karen.skweres, kvolny, llim, mike.miller, mjenner, ohudlick, ovirt-maint, revers, rhughes, riek, sghosh, syeghiay, tao, tpelka, vbenes, yeylon
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: udev-095-14.23.el5 Doc Type: Bug Fix
Doc Text:
Previously, cciss devices did not have an entry in the udev database. This was caused by the fact that these devices do not provide information in the /sys file system, making it hard to create persistent symbolic links in /dev/disk. With this update, the scsi_id utility is used to query the ID of cciss devices, so that udev can create the database entries as expected.
Story Points: ---
Clone Of: 489982 Environment:
Last Closed: 2011-01-13 22:59:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 489982    
Bug Blocks: 499522, 570750, 615270    

Comment 1 Alan Pevec 2009-08-04 18:50:02 UTC
On 08/04/2009 02:41 PM, Alan Pevec wrote:
> Subhendu Ghosh wrote:
>> It looks like the required kernel changes for exposing cciss to hal are
>> already in.
>>
>> The question here is does the new requirement for block.device also
>> require a
>> kernel change - I have not see any response on that.
>
> it is there afaict:
> cat /sys/block/cciss\!c0d0/dev
> 104:0
>
> [root@hp-dl380g5-01 ~]# ls -l /dev/cciss/c0d0
> brw-r----- 1 root disk 104, 0 Aug 4 09:36 /dev/cciss/c0d0
>
> If HAL can convert that to block.device, great.
> If not, I can add this special case in RHEV-H scripts.

Comment 2 Alan Pevec 2009-08-04 18:53:18 UTC
this bug is also relevant for libvirt, which uses hal to enumerate available hardware:

# virsh nodedev-dumpxml  pci_8086_25e3_storage
<device>
 <name>pci_8086_25e3_storage</name>
 <parent>pci_103c_3230</parent>
 <capability type='storage'>
   <block>(null)</block>
   <bus>pci</bus>
   <drive_type>disk</drive_type>
   <size>293564211200</size>
 </capability>
</device>

on "normal" HBAs you get <block>/dev/sdg</block>

Comment 10 Mike Miller (OS Dev) 2009-11-05 15:42:56 UTC
Is anything required from the driver side?

-- mikem

Comment 15 Christopher Aillon 2010-03-04 19:16:39 UTC
Got David to help look at this since he's local to the machines in Westford.  His comments follow:

<<<
I have now spent some time looking into this. My findings are based on
RHEL5.5 with hp-bl460cg5-01.rhts.eng.bos.redhat.com

 udev-095-14.21.el5
 kernel-2.6.18-164.el5
 hal-0.5.8.1-52.el5

To recap, the problem we are trying to solve here is that block.device
is empty for certain cciss devices. After examining the system, it
appears that 

 [root@hp-bl460cg5-01 ~]# udevinfo -q all -p /sys/block/cciss\!c0d0
 no record for '/block/cciss!c0d0' in database

fails despite the existence of /dev/cciss/c0d0. I bet that udev gets it
wrong with the special handling that is required for '!' characters.

Anyway, all this indicates that we are dealing with a udev bug. Once
this is fixed, HAL should work as expected.

Thanks,
David

[1] : Just to check the syntax is correct, note that

 [root@hp-bl460cg5-01 ~]# udevinfo -q all -p /sys/block/cciss\!c0d0/cciss\!c0d0p1
 P: /block/cciss!c0d0/cciss!c0d0p1
 N: cciss/c0d0p1
 S: disk/by-uuid/93db4871-1977-47e4-a350-85b07f5fc33e
 S: disk/by-label/boot
 E: ID_FS_USAGE=filesystem
 E: ID_FS_TYPE=ext3
 E: ID_FS_VERSION=1.0
 E: ID_FS_UUID=93db4871-1977-47e4-a350-85b07f5fc33e
 E: ID_FS_LABEL=/boot
 E: ID_FS_LABEL_SAFE=boot

works as expected.

>>>

Comment 17 Subhendu Ghosh 2010-03-04 20:12:34 UTC
Mike

Is there anyway to stop CCISS from generating /sys etries with "!" ?

Comment 18 Mike Miller (OS Dev) 2010-03-04 22:52:16 UTC
We don't actually do the "!" from the driver. Here's what we do:

cciss_add_disk(ctlr_info_t *h, struct gendisk *disk,
                                int drv_index) {
        disk->queue = blk_init_queue(do_cciss_request, &h->lock);
        if (!disk->queue)
                goto init_queue_failure;
        sprintf(disk->disk_name, "cciss/c%dd%d", h->ctlr, drv_index); <------ here.
        disk->major = h->major;
        disk->first_minor = drv_index << NWD_SHIFT;
        disk->fops = &cciss_fops;
        if (cciss_create_ld_sysfs_entry(h, drv_index))

Something in the upper layers substitutes the slash in the path with a bang since you can't have a slash in a filename. And udev depends on that bang to figure out the cciss device nodes.

Comment 19 Harald Hoyer 2010-03-05 08:50:19 UTC
Because it has no symlinks and anything else:

udev_db_add_device: nothing interesting to store in udevdb, skip

Comment 20 Harald Hoyer 2010-03-05 08:53:37 UTC
this is udev-095, not udev-147!

# udevinfo -q all -n /dev/null
no record for 'null' in database

# udevinfo -q all -n /dev/md0
no record for 'md0' in database


udev-095 only stores entries in the database, if there is something to record!

Comment 21 Harald Hoyer 2010-03-05 08:54:43 UTC
reassigning back to hal

Comment 22 Harald Hoyer 2010-03-05 09:24:23 UTC
adding
50-udev.rules:KERNEL=="cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id -g -x -a -n -s %p -d $tempnode", ENV{ID_BUS}="cciss"

helps though

# udevinfo -q all -n /dev/cciss/c0d0
P: /block/cciss!c0d0
N: cciss/c0d0
E: ID_VENDOR=HP
E: ID_MODEL=LOGICAL_VOLUME
E: ID_REVISION=1.80�
E: ID_SERIAL=3600508b1001033393820202020200000
E: ID_TYPE=disk
E: ID_BUS=cciss

reassigning back to udev..

Comment 23 Harald Hoyer 2010-03-05 09:41:52 UTC
 udev-095-14.22.el5

Comment 25 Subhendu Ghosh 2010-03-05 15:41:05 UTC
cciss now works with scsi_id?

Comment 28 Jaromir Hradilek 2010-07-23 10:45:54 UTC
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.

New Contents:
Previously, cciss devices did not have an entry in the udev database. This was caused by the fact that these devices do not provide information in the /sys file system, making it hard to create persistent symbolic links in /dev/disk. With this update, the scsi_id utility is used to query the ID of cciss devices, so that udev can create the database entries as expected.

Comment 37 errata-xmlrpc 2011-01-13 22:59:35 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-2011-0073.html