Bug 203505 - qla2300 does not set module use count
qla2300 does not set module use count
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Coughlan
Brian Brock
: OtherQA
: 160064 (view as bug list)
Depends On: 160064
Blocks: 211071 216987
  Show dependency treegraph
 
Reported: 2006-08-22 01:57 EDT by Russell Coker
Modified: 2010-10-22 01:45 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-07 01:31:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
RFC: module-reference counting in qla2xxx (7.36 KB, patch)
2006-09-25 17:02 EDT, Andrew Vasquez
no flags Details | Diff

  None (edit)
Description Russell Coker 2006-08-22 01:57:54 EDT
In package kernel-smp-2.6.9-34.0.2.EL for the i686 architecture the driver
qla2300 does not set the module use count.  Removing the module when it's used
for an active filesystem causes bad things to happen as you would expect.
Comment 1 Jason Baron 2006-08-22 14:30:03 EDT
don't do that ;)
Comment 2 Russell Coker 2006-08-24 21:52:46 EDT
My situation is that I have some machines with an excessive number of modules 
in the initrd.  To reduce the size of the initrd I want to remove some.  So I 
try running rmmod on the modules with a 0 use count to make sure that they are 
actually not needed, the module that causes the machine to die when it is 
removed is the one that stays in the initrd.  :(
Comment 3 Tom Coughlan 2006-09-14 16:18:26 EDT
Andrew, 

Would you modify the qla2xxx drivers so they update the module use count? This
will prevent them from being unloaded while in use.

If you can provide this with whatever other changes you submit to us for RHEL
4.5 that would be ideal.

Tom
Comment 4 Andrew Vasquez 2006-09-25 17:01:24 EDT
Patches to 'fix' this quirk with the reference counts not trailing the firmware-loader
modules of qla2xxx have been floating around for some time.  For a variety of reasons
(some I'll list below), we've been trying to educate users to 'not do that' (as was noted in
an earlier comment -- bottom line is you need to be root to modify (load/remove)
modules, at least understand what the implications are).

I'll attach a 'reference patch' which passes the proper module reference down to the
mid-layer sure host-registration.  There are some caveats/quirks though:

1) each firmware-loader needs it own static scsi_host_template
2) duplicate /proc/scsi/qla2xxx entries are created per loader module

(2) could be handled by not overloading proc_name with 'qla2xxx' for each 
firmware-loader and assigning the value based on firmware-loader name, e.g.
qla2300.ko assigns proc_name == 'qla2300'.  Unfortunatelely, there are large
installations which depend on /proc/scsi/qla2xxx/ data for configuration.
A name change at this stage in time is not advisable.

Also, going forward, these module-reference quirks are becoming a non-issue
given the firmware-loader modules have been removed in favor of more flexible
initramfs loading via request_firwmare().
Comment 5 Andrew Vasquez 2006-09-25 17:02:42 EDT
Created attachment 137089 [details]
RFC: module-reference counting in qla2xxx
Comment 6 Tom Coughlan 2006-09-28 09:37:17 EDT
Understood. Thanks Andrew. 

We're not likely to see request_firwmare() in RHEL 4.5 :)
Comment 7 RHEL Product and Program Management 2006-09-28 09:47:27 EDT
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 8 Jay Turner 2006-10-03 09:31:10 EDT
QE ack for 4.5.
Comment 9 Jason Baron 2007-01-05 11:35:42 EST
committed in stream U5 build 42.38. A test kernel with this patch is available
from http://people.redhat.com/~jbaron/rhel4/
Comment 10 Tom Coughlan 2007-01-23 18:04:54 EST
*** Bug 160064 has been marked as a duplicate of this bug. ***
Comment 11 Andrius Benokraitis 2007-01-24 00:19:55 EST
Note to QLOGIC: could you please test this? Thanks!
Comment 13 Scott Scriven 2007-04-04 12:47:06 EDT
This may be the cause of IT 116776 (two instances of /proc/scsi/qla2xxx/ in 
RHEL4U5).
Comment 14 Tom Coughlan 2007-04-04 18:14:14 EDT
It has been determined that this patch can cause a system crash. See BZ 234260.
At this point in the 4.5 schedule we have no choice but to remove this patch. 
Comment 15 Tom Coughlan 2007-04-10 11:34:09 EDT
The following release note is needed for 4.5. We will consider addressing this
in 4.6. 

The QLogic driver in RHEL 4 has two parts, the main driver
(qla2xxx), and a hardware-specific firmware loader (qla2100, qla2200,
qla2300, qla2322, qla2400, qla6312). Both must be loaded for the driver
to work. Currently, the module use count for the qla2xxx module is incremented
when the attached storage is in use. The use count is not incremented for the
firmware loader modules. This means that you must use caution to never rmmod the
firmware module when it is in use. The system will not automatically prevent
this, and I/O errors will result.
Comment 16 Don Domingo 2007-04-10 20:55:42 EDT
adding the following note to 4.5 Release Notes Updates:

<quote>
The QLogic driver in Red Hat Enterprise Linux 4 has two components: the main
driver and a hardware-specific firmware loader. Both components must be loaded
for the driver to work. Currently, the module use count for the main driver is
incremented when the attached storage device is in use. The use count for
firmware loader modules is not incremented.

As a result, the system does not automatically prevent you from performing an
rmmod on the firmware module even when it is in use. Doing so will result in I/O
errors.

As such, you should never remove the firmware module while it is still in use. 
</quote>

please confirm if this note is sufficient. if so, we'll have it posted on the
Release Notes Updates within 24 hours.

thanks!
Comment 17 Andrew Vasquez 2007-04-10 21:19:12 EDT
Only correction I can suggest is modifying the following:

  As such, you should never remove the firmware module while it is still in use.

to read as:

  As such, you should never remove the firmware module while
  the main driver module is still in use.
Comment 18 Don Domingo 2007-04-10 21:32:43 EDT
corrected accordingly. thanks!

release notes updates should be... updated within 24 hours or so.
Comment 19 RHEL Product and Program Management 2007-05-09 05:47:12 EDT
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 20 Andrius Benokraitis 2007-07-05 14:11:47 EDT
Red Hat is assuming this bugzilla is only for the release note, and will revisit
this for a fix in the future.
Comment 21 RHEL Product and Program Management 2007-09-07 15:43:56 EDT
This request was previously evaluated by Red Hat Product Management
for inclusion in the current Red Hat Enterprise Linux release, but
Red Hat was unable to resolve it in time.  This request will be
reviewed for a future Red Hat Enterprise Linux release.

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