linux/drivers
Andreas Herrmann 04846f2592 [SCSI] limit recursion when flushing shost->starved_list
Attached is a patch that should limit a possible recursion that can
lead to a stack overflow like follows:

Kernel stack overflow.
CPU:    3    Not tainted
Process zfcperp0.0.d819
(pid: 13897, task: 000000003e0d8cc8, ksp: 000000003499dbb8)
Krnl PSW : 0404000180000000 000000000030f8b2 (get_device+0x12/0x48)
Krnl GPRS: 00000000135a1980 000000000030f758 000000003ed6c1e8 0000000000000005
           0000000000000000 000000000044a780 000000003dbf7000 0000000034e15800
           000000003621c048 070000003499c108 000000003499c1a0 000000003ed6c000
           0000000040895000 00000000408ab630 000000003499c0a0 000000003499c0a0
Krnl Code: a7 fb ff e8 a7 19 00 00 b9 02 00 22 e3 e0 f0 98 00 24 a7 84
Call Trace:
([<000000004089edc2>] scsi_request_fn+0x13e/0x650 [scsi_mod])
 [<00000000002c5ff4>] blk_run_queue+0xd4/0x1a4
 [<000000004089ff8c>] scsi_queue_insert+0x22c/0x2a4 [scsi_mod]
 [<000000004089779a>] scsi_dispatch_cmd+0x8a/0x3d0 [scsi_mod]
 [<000000004089f1ec>] scsi_request_fn+0x568/0x650 [scsi_mod]
...
 [<000000004089f1ec>] scsi_request_fn+0x568/0x650 [scsi_mod]
 [<00000000002c5ff4>] blk_run_queue+0xd4/0x1a4
 [<000000004089ff8c>] scsi_queue_insert+0x22c/0x2a4 [scsi_mod]
 [<000000004089779a>] scsi_dispatch_cmd+0x8a/0x3d0 [scsi_mod]
 [<000000004089f1ec>] scsi_request_fn+0x568/0x650 [scsi_mod]
 [<00000000002c5ff4>] blk_run_queue+0xd4/0x1a4
 [<000000004089fa9e>] scsi_run_host_queues+0x196/0x230 [scsi_mod]
 [<00000000409eba28>] zfcp_erp_thread+0x2638/0x3080 [zfcp]
 [<0000000000107462>] kernel_thread_starter+0x6/0xc
 [<000000000010745c>] kernel_thread_starter+0x0/0xc
<0>Kernel panic - not syncing: Corrupt kernel stack, can't continue.

This stack overflow occurred during tests on s390 using zfcp.
Recursion depth for this panic was 19.

Usually recursion between blk_run_queue and a request_fn is avoided
using QUEUE_FLAG_REENTER. But this does not help if the scsi stack
tries to flush the starved_list of a scsi_host.

Limit recursion depth when flushing the starved_list
of a scsi_host.

Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-08-19 13:31:53 -07:00
..
acorn [PATCH] irq-flags: misc drivers: Use the new IRQF_ constants 2006-07-02 13:58:50 -07:00
acpi [PATCH] Revert "ACPI: execute Notify() handlers on new thread" 2006-07-12 21:02:24 -07:00
amba [PATCH] 64bit resource: fix up printks for resources in misc drivers 2006-06-27 09:23:59 -07:00
atm [ATM]: Typo in drivers/atm/Kconfig... 2006-07-08 13:30:09 -07:00
base [PATCH] Driver core: bus.c cleanups 2006-07-12 16:09:08 -07:00
block [SCSI] Improve inquiry printing 2006-08-06 15:59:26 -05:00
bluetooth [Bluetooth] Enable SCO support for Broadcom HID proxy dongle 2006-07-24 12:44:34 -07:00
cdrom [PATCH] cdrom: fix bad cgc.buflen assignment 2006-07-10 13:24:15 -07:00
char [WAN]: Converted synclink drivers to use netif_carrier_*() 2006-07-21 14:44:55 -07:00
clocksource
connector
cpufreq [PATCH] Reorganize the cpufreq cpu hotplug locking to not be totally bizare 2006-07-26 07:21:40 -07:00
crypto [CRYPTO] padlock: Fix alignment after aes_ctx rearrange 2006-07-15 11:08:50 +10:00
dio
dma [I/OAT]: Remove pci_module_init() from Intel I/OAT DMA engine 2006-07-21 14:50:13 -07:00
edac [PATCH] Fix and enable EDAC sysfs operation 2006-07-10 13:24:25 -07:00
eisa Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
fc4 [SCSI] More buffer->request_buffer changes 2006-07-14 09:41:13 -05:00
firmware Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
hwmon [PATCH] hwmon: Fix for first generation Abit uGuru chips 2006-07-12 15:43:07 -07:00
i2c [PATCH] pca9539: Honor the force parameter 2006-07-12 15:43:07 -07:00
ide Revert "[PATCH] pcmcia: Make ide_cs work with the memory space of CF-Cards if IO space is not available" 2006-07-12 21:04:16 -07:00
ieee1394 [PATCH] lockdep: annotate ieee1394 skb-queue-head locking 2006-07-03 15:27:08 -07:00
infiniband IB/mthca: Initialize max_cmds before debug code prints it 2006-07-24 09:36:50 -07:00
input [PATCH] lockdep: annotate serio 2006-07-03 15:27:07 -07:00
isdn [PATCH] isdn: cleanup i_rdev udage 2006-07-10 13:24:27 -07:00
leds [PATCH] net48xx LED cleanups 2006-07-14 21:53:54 -07:00
macintosh [PATCH] powermac: Combined fixes for backlight code 2006-07-10 13:24:20 -07:00
mca
md [PATCH] md: fix oops in error-handling 2006-07-10 13:24:17 -07:00
media [PATCH] release_firmware() fixes 2006-07-10 13:24:15 -07:00
message [SCSI] mptfc: add additional fc transport attributes 2006-08-06 15:49:15 -05:00
mfd [ARM] 3727/1: fix ucb initialization on collie 2006-07-11 22:54:15 +01:00
misc [PATCH] irq-flags: misc drivers: Use the new IRQF_ constants 2006-07-02 13:58:50 -07:00
mmc [MMC] Change SDHCI version error to a warning 2006-07-13 16:17:46 +01:00
mtd Merge git://git.infradead.org/mtd-2.6 2006-07-03 21:29:08 -07:00
net [TG3]: Update version and reldate 2006-07-25 16:39:12 -07:00
nubus Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
oprofile
parisc [PATCH] irq-flags: PARISC: Use the new IRQF_ constants 2006-07-02 13:58:52 -07:00
parport [PATCH] irq-flags: misc drivers: Use the new IRQF_ constants 2006-07-02 13:58:50 -07:00
pci [PATCH] PCI: PCIE power management quirk 2006-07-12 16:05:48 -07:00
pcmcia [PATCH] don't select CONFIG_HOTPLUG 2006-07-10 13:24:12 -07:00
pnp [PATCH] PNPACPI: support shareable interrupts 2006-07-03 15:26:58 -07:00
rapidio Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
rtc [PATCH] RTC subsystem, Add ISL1208 support 2006-07-14 21:53:53 -07:00
s390 [S390] sysfs_create_xxx return values. 2006-07-18 13:46:58 +02:00
sbus [SPARC] sbus: Make sure sbus nodes are named uniquely. 2006-07-21 14:18:06 -07:00
scsi [SCSI] limit recursion when flushing shost->starved_list 2006-08-19 13:31:53 -07:00
serial [SERIAL] sunzilog: Fix instance enumeration. 2006-07-21 14:18:25 -07:00
sh
sn [PATCH] irq-flags: misc drivers: Use the new IRQF_ constants 2006-07-02 13:58:50 -07:00
spi [PATCH] lockdep: annotate on-stack completions 2006-07-03 15:27:09 -07:00
tc [PATCH] irq-flags: misc drivers: Use the new IRQF_ constants 2006-07-02 13:58:50 -07:00
telephony Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/devfs-2.6 2006-06-29 14:19:21 -07:00
usb [PATCH] USB: move usb-serial.h to include/linux/usb/ 2006-07-12 16:03:25 -07:00
video [PATCH] mbxfb: Add framebuffer driver for the Intel 2700G 2006-07-14 21:53:55 -07:00
w1 [PATCH] w1: remove drivers/w1/w1.h 2006-07-12 15:38:28 -07:00
zorro Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Kconfig
Makefile