3

I routinely cannot unload the Qlogic fibre module qla2xxx under CentOS 5 or 6. These machines are running StorNext cvfs, EMC powerpath and hostagent. Nothing else should ever be touching the fibre. All three of these processes have been stopped before trying to remove the module. The interesting thing of the output below is the lsmod: qla2xxx is being used by 45 things but none are listed. There are no "fibre-ish" processes visible (that I can tell) after running sudo ps ax. I have not tried a "force (-f)" removal Force removal (-f) does not help the situation.

# service cvfs status
Active SNFS mountpoints:
Error: fsmpm not running!

# service PowerPath stop
Stopping PowerPath: PowerPath is not running done

# service hostagent status
hostagent is stopped

# modprobe -v -r qla2xxx
FATAL: Module qla2xxx is in use.

# rmmod -v qla2xxx
ERROR: Module qla2xxx is in use

# lsmod | grep qla
qla2xxx               366555  45 
scsi_transport_fc      52241  1 qla2xxx

# modprobe --show-depends qla2xxx
insmod /lib/modules/2.6.32-220.7.1.el6.x86_64/kernel/drivers/scsi/scsi_tgt.ko 
insmod /lib/modules/2.6.32-220.7.1.el6.x86_64/kernel/drivers/scsi/scsi_transport_fc.ko 
insmod /lib/modules/2.6.32-220.7.1.el6.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko ql2xfailover=0

# modprobe -r -v scsi_transport_fc
FATAL: Module scsi_transport_fc is in use.

# modprobe --show-depends scsi_transport_fc
insmod /lib/modules/2.6.32-220.7.1.el6.x86_64/kernel/drivers/scsi/scsi_tgt.ko 
insmod /lib/modules/2.6.32-220.7.1.el6.x86_64/kernel/drivers/scsi/scsi_transport_fc.ko

# lsmod | grep scsi_
scsi_transport_fc      52241  1 qla2xxx
scsi_tgt               12173  1 scsi_transport_f

# modprobe -r -v scsi_tgt
FATAL: Module scsi_tgt is in use.

# modprobe --show-depends scsi_tgt
insmod /lib/modules/2.6.32-220.7.1.el6.x86_64/kernel/drivers/scsi/scsi_tgt.ko 

Update: There is a kernel thread persisting for each HBA on the host, which should be killed when I attempt to remove the module.

# ps ax | grep qla
  551 ?        S<     0:00 [qla2xxx_0_dpc]
  557 ?        S<     0:00 [qla2xxx_1_dpc]
  563 ?        S<     0:00 [qla2xxx_2_dpc]
  569 ?        S<     0:00 [qla2xxx_3_dpc]
greg
  • 101
  • 1
  • 7

3 Answers3

1

The problem you are facing can be a bug. See:

http://www.spinics.net/lists/linux-scsi/msg52025.html

Peter
  • 849
  • 8
  • 10
  • Could be a bug, but not this one. The link is a patch for a hang during driver unload. In this case, the module won't begin the unload because it is in use. – greg May 14 '12 at 01:20
  • This bug is about ref count not being handled correctly. You reported ref count = 45 which does not looks normal. – Peter May 14 '12 at 12:38
0

Have you tried to remove all in a single operation ?

modprobe -r -f -v scsi_tgt scsi_transport_fc qla2xxx

I am not sure my alternate proposal matches your needs: adding the following line to /etc/modprobe.conf

alias qla2xxx off

will prevent the module auto-loading at boot time and so your dependency-lock situation but it requires to reboot...

Yves Martin
  • 879
  • 3
  • 7
  • 21
  • Combining all modules into a single operation does not work. Preventing the module from loading at boot doesn't fit my goals. I would like the module to load at boot so I can mount my SAN file systems at boot, but I'd like to be able to perform fibre maintenance without having to reboot and kick off all users. – greg May 10 '12 at 15:01
  • So I have guessed well... – Yves Martin May 10 '12 at 15:04
0

Try:

service multipathd stop
multipath -F 
modprobe -r -f -v scsi_tgt scsi_transport_fc qla2xxx
Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79
pmg
  • 1