linux-stable/drivers
Abhijeet Joglekar b4c6f54632 [SCSI] libfc: Track rogue remote ports
Rogue ports are currently not tracked on any list. The only reference
to them is through any outstanding exchanges pending on the rogue ports.
If the module is removed while a retry is set on a rogue port
(say a Plogi retry for instance), this retry is not cancelled because there
is no reference to the rogue port in the discovery rports list. Thus the
local port can clean itself up, delete the exchange pool, and then the
rogue port timeout can fire and try to start up another exchange.

This patch tracks the rogue ports in a new list disc->rogue_rports. Creating
a new list instead of using the disc->rports list keeps remote port code
change to a minimum.

1)  Whenever a rogue port is created, it is immediately added to the
disc->rogue_rports list.

2) When the rogues port goes to ready, it is removed from the rogue list
and the real remote port is added to the disc->rports list

3) The removal of the rogue from the disc->rogue_rports list is done in
the context of the fc_rport_work() workQ thread in discovery callback.

4) Real rports are removed from the disc->rports list like before. Lookup
is done only in the real rports list. This avoids making large changes
to the remote port code.

5) In fc_disc_stop_rports, the rogues list is traversed in addition to the
real list to stop the rogue ports and issue logoffs on them. This way, rogue
ports get cleaned up when the local port goes away.

6) rogue remote ports are not removed from the list right away, but
removed late in fc_rport_work() context, multiple threads can find the same
remote port in the list and call rport_logoff(). Rport_logoff() only
continues with the logoff if port is not in NONE state, thus preventing
multiple logoffs and multiple list deletions.

7) Since the rport is removed from the disc list at a later stage
(in the disc callback), incoming frames can find the rport even if
rport_logoff() has been called on the rport. When rport_logoff() is called,
the rport state is set to NONE, and we are trying to cancel all exchanges
and retries on that port. While in this state, if an incoming
Plogi/Prli/Logo or other frames match the rport, we should not reply
because the rport is in the NONE state. Just drop the frame, since the
rport will be deleted soon in the disc callback (fc_rport_work)

8)  In fc_disc_single(), remove rport lookup and call to fc_disc_del_target.
fc_disc_single() is called from recv_rscn_req() where rport lookup
and rport_logoff is already done.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-27 10:18:57 -05:00
..
accessibility
acpi Merge branch 'bjorn.button' into release 2009-04-24 10:42:29 -04:00
amba
ata [libata] fix build error on drivers/ata/pata_legacy.c 2009-04-17 19:05:33 -04:00
atm Replace all DMA_nBIT_MASK macro with DMA_BIT_MASK(n) 2009-04-13 15:04:33 -07:00
auxdisplay
base driver synchronization: make scsi_wait_scan more advanced 2009-04-21 19:40:00 -07:00
block umem: fix request_queue lock warning 2009-04-24 08:54:21 +02:00
bluetooth
cdrom
char virtio-rng: Remove false BUG for spurious callbacks 2009-04-24 13:28:30 -07:00
clocksource clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
connector
cpufreq
cpuidle
crypto dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
dca
dio
dma dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
edac edac: ppc mpc85xx fix mc err detect 2009-04-21 13:41:51 -07:00
eisa
firewire
firmware dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
gpio Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-04-03 15:24:35 -07:00
gpu ACPI, i915: Register ACPI video even when not modesetting 2009-04-24 00:42:06 -04:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2009-04-03 15:25:44 -07:00
hwmon hwmon: sht15 humidity sensor driver 2009-04-13 15:04:29 -07:00
i2c i2c: Let new-style drivers implement attach_adapter 2009-04-13 17:02:14 +02:00
ide palm_bk3710: palm_bk3710_udmatimings[] CodingStyle fixup 2009-04-23 22:53:45 +02:00
idle dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64) 2009-04-07 08:31:10 -07:00
ieee1394 dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
infiniband [SCSI] cxgb3i, iser, iscsi_tcp: set target can queue 2009-04-27 10:09:54 -05:00
input drivers/input/serio/hp_sdc.c: fix crash when removing hp_sdc module 2009-04-21 13:41:49 -07:00
isdn USB: add reset endpoint operations 2009-04-17 10:50:27 -07:00
leds leds: just ignore invalid GPIOs in leds-gpio 2009-04-08 14:13:48 +01:00
lguest lguest: fix guest crash on non-linear addresses in gdt pvops 2009-04-19 23:14:01 +09:30
macintosh Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 2009-04-24 08:16:05 -07:00
mca
md Merge branch 'for-linus' of git://neil.brown.name/md 2009-04-20 08:37:37 -07:00
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2009-04-24 08:36:06 -07:00
memstick dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
message scsi: mpt: suppress debugobjects warning 2009-04-21 13:41:50 -07:00
mfd mfd: fix da903x warning 2009-04-05 00:32:25 +02:00
misc sgi-xp/sgi-gru: allow modules to load on non-uv systems 2009-04-21 13:41:50 -07:00
mmc mmc_spi: support for non-byte-aligned cards 2009-04-08 20:45:51 +02:00
mtd cafe_nand: Fix warning 2009-04-24 07:52:08 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2009-04-24 07:46:51 -07:00
nubus
of
oprofile Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-04-05 11:04:19 -07:00
parisc parport: Fix various uses of parport_pc 2009-04-14 08:48:50 -07:00
parport parport: Use the PCI IRQ if offered 2009-04-07 08:44:06 -07:00
pci Merge git://git.infradead.org/iommu-2.6 2009-04-13 11:35:50 -07:00
pcmcia [ARM] 5458/1: pcmcia: pxa2xx-sharpsl: check if we do have Scoop config 2009-04-23 23:25:40 +01:00
platform Merge branch 'sony-laptop' into release 2009-04-24 01:34:52 -04:00
pnp dma-mapping: replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24) 2009-04-07 08:31:12 -07:00
power Merge git://git.infradead.org/battery-2.6 2009-04-08 17:45:02 -07:00
ps3
rapidio dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
regulator
rtc rtc-cmos: fix printk output 2009-04-21 13:41:50 -07:00
s390 [SCSI] zfcp: Fix oops when port disappears 2009-04-27 10:07:37 -05:00
sbus sbus: changed ioctls to unlocked 2009-04-14 19:46:19 -07:00
scsi [SCSI] libfc: Track rogue remote ports 2009-04-27 10:18:57 -05:00
serial serial: remove contact data 2009-04-24 07:52:08 -07:00
sh sh: intc: Added resume from hibernation support to the intc 2009-04-06 08:55:19 -07:00
sn dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64) 2009-04-07 08:31:10 -07:00
spi spi: pxa2xx: limit reaches -1 2009-04-21 13:41:49 -07:00
ssb
staging go7007: Convert to the new i2c device binding model 2009-04-21 21:47:22 +02:00
tc
telephony
thermal
uio UIO: fix specific device driver missing statement for depmod 2009-04-16 16:17:11 -07:00
usb USB: otg: Fix bug on remove path without transceiver 2009-04-23 14:15:31 -07:00
uwb dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
video pxafb: lcsr1 is unused without CONFIG_FB_PXA_OVERLAY 2009-04-21 13:41:47 -07:00
virtio virtio: fix suspend when using virtio_balloon 2009-04-19 23:14:01 +09:30
w1 mfd: remove DS1WM clock handling 2009-04-05 00:32:22 +02:00
watchdog [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
xen xen: honour VCPU availability on boot 2009-04-08 14:25:51 -07:00
zorro
Kconfig
Makefile