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 513070

Summary: cciss disk devices do not have storage capability in HAL
Product: Red Hat Enterprise Linux 5 Reporter: Tom Coughlan <coughlan>
Component: kernelAssignee: Rob Evers <revers>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 5.4CC: apevec, azarembo, cmeadors, dzickus, jzapleta, karen.skweres, llim, mike.miller, mjenner, ohudlick, ovirt-maint, revers, rhughes, rpacheco, sghosh, syeghiay, vbenes, yeylon
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 489982 Environment:
Last Closed: 2009-09-02 08:35:05 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:    
Attachments:
Description Flags
original patch from Mike Miller
none
Mike Miller's patch without fix for 510178, which is already committed
none
call bus_unregister in cciss_remove_one none

Comment 1 RHEL Program Management 2009-07-21 20:34:24 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 2 Rob Evers 2009-07-22 10:50:47 UTC
Created attachment 354668 [details]
original patch from Mike Miller

Comment 3 Rob Evers 2009-07-22 10:56:32 UTC
Created attachment 354670 [details]
Mike Miller's patch without fix for 510178, which is already committed

Comment 4 Rob Evers 2009-07-22 10:58:28 UTC
Comment on attachment 354668 [details]
original patch from Mike Miller

Originally attached for reference only.

Comment 8 Rob Evers 2009-07-27 11:37:44 UTC
Comment from Redhat internal code review:

>
> @@ -4040,10 +4308,24 @@ static struct pci_driver cciss_pci_driver = {
>    */
>   static int __init cciss_init(void)
>   {
> +    int err;
> +
>       printk(KERN_INFO DRIVER_NAME "\n");
>
> +    err = bus_register(&cciss_bus_type);


I did not see a bus_unregister when the module is unloaded.

Comment 9 Mike Miller (OS Dev) 2009-07-27 15:38:27 UTC
Created attachment 355289 [details]
call bus_unregister in cciss_remove_one

Patch to call bus_unregister during module unload.

Comment 16 Don Zickus 2009-07-28 20:13:56 UTC
in kernel-2.6.18-160.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 20 Rob Evers 2009-07-30 19:14:11 UTC
Mike Miller,

Another problem was noticed after this was accepted, during a late internal code review:

-----

> +++ b/drivers/block/cciss.c
> > +static ssize_t dev_show_vendor(struct device *dev,
> > +			       struct device_attribute *attr, char *buf)
> > +{
> > +	drive_info_struct *drv = to_drv(dev);
> > +	struct ctlr_info *h = to_hba(dev->parent);
> > +	char vendor[VENDOR_LEN + 1];
> > +	unsigned long flags;
> > +	int ret = 0;
> > +
> > +	spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags);
> > +	if (h->busy_configuring)
> > +		ret = -EBUSY;
> > +	else
> > +		memcpy(vendor, drv->vendor, VENDOR_LEN + 1);
> > +	spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
> > +
> > +	if (ret)
> > +		return ret;
> > +	else
> > +		return snprintf(buf, sizeof(vendor) + 1, "%s\n", drv->vendor);
> > +}

I do not understand why snprintf uses drv->vendor after you have
gone to the trouble of copying it out into auto array vendor[].

> > +		memcpy(model, drv->model, MODEL_LEN + 1);
> > +		return snprintf(buf, sizeof(model) + 1, "%s\n", drv->model);

Same here.

> > +		memcpy(rev, drv->rev, REV_LEN + 1);
> > +		return snprintf(buf, sizeof(rev) + 1, "%s\n", drv->rev);

Here, too. Clearly I misunderstand the intent of the author or
fail to read the code. Care to help me out?

-----

Can you get a patch for this upstream, and roll it into the next cciss update for rhel5.5?

Rob

Comment 21 Mike Miller (OS Dev) 2009-07-30 21:17:10 UTC
Not being the original author I'm not sure what the intent may have been. It seem to more of a cosmetic issue than anything but I will submit patches upstream.

Comment 22 Alan Pevec 2009-08-05 16:54:23 UTC
Not sure if it is something in sysfs or just udev rule missing, but with kernel-2.6.18-160 and hal-0.5.8.1-52.el5 I don't get /dev/disk/by-id/cciss-* symlinks, while on Fedora they're created (Fedora version tested was F8 with kernel-2.6.23.1-42.fc8 and udev-116-3.fc8)

Comment 23 Alan Pevec 2009-08-05 22:05:06 UTC
(In reply to comment #22)
> Not sure if it is something in sysfs or just udev rule missing, but with
> kernel-2.6.18-160 and hal-0.5.8.1-52.el5 I don't get /dev/disk/by-id/cciss-*
> symlinks, while on Fedora they're created (Fedora version tested was F8 with
> kernel-2.6.23.1-42.fc8 and udev-116-3.fc8)  

scsi_id doesn't work with cciss - meaning driver doesn't support SCSI INQUIRY?

Comment 24 Alan Pevec 2009-08-06 00:54:58 UTC
workaround using cciss_id (from device-mapper-multipath RPM)

/lib/udev/cciss.sh:
#!/bin/sh
echo ID_SERIAL=$(/sbin/cciss_id $1)

/etc/udev/rules.d/60-cciss.rules:
KERNEL=="cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}=="", IMPORT{program}="cciss.sh %p", ENV{ID_BUS}="cciss"
KERNEL=="cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="cciss*p[0-9]*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

Comment 27 errata-xmlrpc 2009-09-02 08:35:05 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/RHSA-2009-1243.html