Bug 513070 - cciss disk devices do not have storage capability in HAL
Summary: cciss disk devices do not have storage capability in HAL
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.4
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Rob Evers
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On: 489982
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-21 20:28 UTC by Tom Coughlan
Modified: 2016-04-26 14:05 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 489982
Environment:
Last Closed: 2009-09-02 08:35:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
original patch from Mike Miller (14.02 KB, patch)
2009-07-22 10:50 UTC, Rob Evers
no flags Details | Diff
Mike Miller's patch without fix for 510178, which is already committed (11.78 KB, patch)
2009-07-22 10:56 UTC, Rob Evers
no flags Details | Diff
call bus_unregister in cciss_remove_one (506 bytes, patch)
2009-07-27 15:38 UTC, Mike Miller (OS Dev)
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1243 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.4 kernel security and bug fix update 2009-09-01 08:53:34 UTC

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


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