Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers
Robert Love 2280512342 [SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up
The rtnl_lock is primarily used to serialize networking
driver changes as well as to ensure that a networking driver
is not removed when making changes to it. fcoe also uses
the rtnl_lock to protect the fcoe hostlist.

fcoe_create holds the rtnl_lock over the entirity of the
routine including a the call to fcoe_ctlr_link_up.
This causes the below deadlock because fcoe_ctlr_link_up
acquires the fcoe_ctlr ctlr_mutex and this deadlocks with
a libfcoe thread that acquires the fcoe_ctlr ctlr_mutex and
then the rtnl_lock (to update a MAC address).

This patch drops the rtnl_lock before calling
fcoe_ctlr_link_up and therefore the deadlock is prevented.

https://bugzilla.kernel.org/show_bug.cgi?id=42918

the existing dependency chain (in reverse order) is:

-> #1 (&fip->ctlr_mutex){+.+...}:
       [<c1091f70>] lock_acquire+0x80/0x1b0
       [<c147655d>] mutex_lock_nested+0x6d/0x340
       [<f8970c32>] fcoe_ctlr_link_up+0x22/0x180 [libfcoe]
       [<f894620e>] fcoe_create+0x47e/0x6e0 [fcoe]
       [<f8973dd3>] fcoe_transport_create+0x143/0x250 [libfcoe]
       [<c10527e0>] param_attr_store+0x30/0x60
       [<c1052696>] module_attr_store+0x26/0x40
       [<c11a201e>] sysfs_write_file+0xae/0x100
       [<c11449df>] vfs_write+0x8f/0x160
       [<c1144cbd>] sys_write+0x3d/0x70
       [<c147a0c4>] syscall_call+0x7/0xb

-> #0 (rtnl_mutex){+.+.+.}:
       [<c109164b>] __lock_acquire+0x140b/0x1720
       [<c1091f70>] lock_acquire+0x80/0x1b0
       [<c147655d>] mutex_lock_nested+0x6d/0x340
       [<c13a10c4>] rtnl_lock+0x14/0x20
       [<f89445ac>] fcoe_update_src_mac+0x2c/0xb0 [fcoe]
       [<f8971712>] fcoe_ctlr_timer_work+0x712/0xb60 [libfcoe]
       [<c104fb69>] process_one_work+0x179/0x5d0
       [<c10502f1>] worker_thread+0x121/0x2d0
       [<c10550ed>] kthread+0x7d/0x90
       [<c1481a82>] kernel_thread_helper+0x6/0x10

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&fip->ctlr_mutex);
                               lock(rtnl_mutex);
                               lock(&fip->ctlr_mutex);
  lock(rtnl_mutex);

 *** DEADLOCK ***

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-03-28 10:06:34 +01:00
..
accessibility
acpi ACPI: remove duplicated lines of merging problems with acpi_processor_add 2012-02-08 15:07:03 -08:00
amba
ata [SCSI] libsas: async ata scanning 2012-02-29 15:35:41 -06:00
atm
auxdisplay
base driver-core: cpu: fix kobject warning when hotplugging a cpu 2012-02-08 15:11:17 -08:00
bcma bcma: don't fail for bad SPROM CRC 2012-02-06 14:37:52 -05:00
block Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2012-02-11 10:07:11 -08:00
bluetooth
cdrom cdrom: move shared static to cdrom_device_info 2012-02-08 20:03:14 +01:00
char agp: fix scratch page cleanup 2012-01-26 18:36:48 +00:00
clk
clocksource
connector
cpufreq
cpuidle
crypto
dca
devfreq
dio
dma i.MX SDMA: Fix burstsize settings 2012-02-02 14:00:43 +05:30
edac
eisa
firewire firewire: ohci: disable MSI on Ricoh controllers 2012-01-30 21:33:34 +01:00
firmware
gpio gpio: Add missing spin_lock_init in gpio-ml-ioh driver 2012-02-01 21:59:37 -07:00
gpu Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux into drm-fixes 2012-02-10 08:35:19 +00:00
hid HID: wiimote: fix invalid power_supply_powers call 2012-02-07 13:40:56 +01:00
hv
hwmon hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured value 2012-02-09 11:21:49 -08:00
hwspinlock
i2c i2c: OMAP: Fix OMAP1 build error 2012-01-20 08:24:22 -08:00
ide block: add and use scsi_blk_cmd_ioctl 2012-01-14 15:07:24 -08:00
idle ACPI processor hotplug: Delay acpi_processor_start() call for hotplugged cores 2012-01-19 21:26:32 -05:00
ieee802154
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-02-10 14:18:46 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2012-02-04 10:57:42 -08:00
iommu iommu/msm: Fix error handling in msm_iommu_unmap() 2012-01-30 12:53:14 +01:00
isdn isdn: type bug in isdn_net_header() 2012-02-09 15:41:29 -05:00
leds drivers/leds/leds-lm3530.c: fix setting pltfm->als_vmax 2012-02-08 19:03:51 -08:00
lguest
macintosh
mca
md Some simple md-related fixes. 2012-02-08 19:06:30 -08:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-01-26 17:04:47 -08:00
memstick
message
mfd mfd: Avoid twl6040-codec PLL reconfiguration when not needed 2012-02-03 19:03:50 +01:00
misc Minor char-misc fixes for 3.3-rc3 2012-02-09 13:51:13 -08:00
mmc drivers: misc: Remove MISC_DEVICES config option 2012-01-24 16:24:02 -08:00
mtd - Fix a regression in 16-bit Atmel NAND flash which was introduced in 3.1 2012-02-04 07:17:47 -08:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-02-10 14:18:46 -08:00
nfc
nubus
of 2nd set of device tree changes for v3.3 2012-01-14 13:25:55 -08:00
oprofile
parisc
parport Autogenerated GPG tag for Rusty D1ADB8F1: 15EE 8D6C AB0E 7F0C F999 BFCB D920 0E6C D1AD B8F1 2012-01-14 12:32:16 -08:00
pci kernel-doc: fix new warnings in pci 2012-01-23 08:44:53 -08:00
pcmcia pcmcia: fix socket refcount decrementing on each resume 2012-02-08 19:03:51 -08:00
pinctrl pinctrl: add checks for empty function names 2012-01-26 14:13:11 +01:00
platform
pnp
power
pps
ps3
ptp
rapidio
regulator This fixes an integration issue with the regulator device tree bindings 2012-01-30 10:16:25 -08:00
rtc Revert "RTC: sa1100: remove redundant code of setting alarm" 2012-01-19 17:26:26 +00:00
s390 [S390] dasd: revalidate server for new pathgroup 2012-01-18 18:03:42 +01:00
sbus
scsi [SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up 2012-03-28 10:06:34 +01:00
sfi
sh
sn
spi spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver 2012-02-05 23:24:17 -07:00
ssb ssb: fix cardbus slot in hostmode 2012-02-01 15:26:00 -05:00
staging staging: pohmelfs: remove drivers/staging/pohmelfs 2012-02-08 16:19:06 -08:00
target target: Fix unsupported WRITE_SAME sense payload 2012-02-07 06:48:58 +00:00
tc
telephony
thermal thermal: Rename generate_netlink_event 2012-01-23 03:15:25 -05:00
tty tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds 2012-02-09 10:48:36 -08:00
uio
usb USB: usbserial: add new PID number (0xa951) to the ftdi driver 2012-02-03 11:22:44 -08:00
uwb
vhost vhost-net: add module alias (v2.1) 2012-01-13 10:12:23 -08:00
video fbdev fixes for 3.3 2012-02-07 15:54:02 -08:00
virt
virtio virtio: correct the memory barrier in virtqueue_kick_prepare() 2012-01-28 08:10:23 +10:30
vlynq
w1
watchdog watchdog: iTCO_wdt: add Intel Lynx Point DeviceIDs 2012-01-27 10:01:16 +01:00
xen xen/granttable: Disable grant v2 for HVM domains. 2012-01-27 11:14:16 -05:00
zorro
Kconfig
Makefile