linux/drivers
Mike Snitzer c3a0ce2eab dm thin: fix unprotected use of prepared_discards list
Fix two places in commit 104655fd4d ("dm thin: support discards") that
didn't use pool->lock to protect against concurrent changes to the
prepared_discards list.

Without this fix, thin_endio() can race with process_discard(), leading
to concurrent list_add()s that result in the processes locking up with
an error like the following:

WARNING: at lib/list_debug.c:32 __list_add+0x8f/0xa0()
...
list_add corruption. next->prev should be prev (ffff880323b96140), but was ffff8801d2c48440. (next=ffff8801d2c485c0).
...
Pid: 17205, comm: kworker/u:1 Tainted: G        W  O 3.4.0-rc3.snitm+ #1
Call Trace:
 [<ffffffff8103ca1f>] warn_slowpath_common+0x7f/0xc0
 [<ffffffff8103cb16>] warn_slowpath_fmt+0x46/0x50
 [<ffffffffa04f6ce6>] ? bio_detain+0xc6/0x210 [dm_thin_pool]
 [<ffffffff8124ff3f>] __list_add+0x8f/0xa0
 [<ffffffffa04f70d2>] process_discard+0x2a2/0x2d0 [dm_thin_pool]
 [<ffffffffa04f6a78>] ? remap_and_issue+0x38/0x50 [dm_thin_pool]
 [<ffffffffa04f7c3b>] process_deferred_bios+0x7b/0x230 [dm_thin_pool]
 [<ffffffffa04f7df0>] ? process_deferred_bios+0x230/0x230 [dm_thin_pool]
 [<ffffffffa04f7e42>] do_worker+0x52/0x60 [dm_thin_pool]
 [<ffffffff81056fa9>] process_one_work+0x129/0x450
 [<ffffffff81059b9c>] worker_thread+0x17c/0x3c0
 [<ffffffff81059a20>] ? manage_workers+0x120/0x120
 [<ffffffff8105eabe>] kthread+0x9e/0xb0
 [<ffffffff814ceda4>] kernel_thread_helper+0x4/0x10
 [<ffffffff8105ea20>] ? kthread_freezable_should_stop+0x70/0x70
 [<ffffffff814ceda0>] ? gs_change+0x13/0x13
---[ end trace 7e0a523bc5e52692 ]---

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-05-12 01:43:16 +01:00
..
accessibility
acpi Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-05-05 10:06:06 -07:00
amba
ata Change summary: 2012-05-03 17:16:52 -07:00
atm
auxdisplay
base
bcma
block
bluetooth Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth 2012-04-27 15:16:43 -04:00
cdrom
char
clk
clocksource
connector
cpufreq
cpuidle
crypto
dca
devfreq
dio
dma Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma 2012-04-26 15:33:36 -07:00
edac
eisa
firewire
firmware efivars: Improve variable validation 2012-05-03 17:19:19 -07:00
gpio ARM: pxa: fix gpio wakeup setting 2012-04-27 10:46:45 +08:00
gpu drm/radeon: clarify and extend wb setup on APUs and NI+ asics 2012-05-04 09:36:11 +01:00
hid
hsi
hv
hwmon hwmon: (coretemp) Increase CPU core limit 2012-05-01 09:16:14 -07:00
hwspinlock
i2c i2c: mxs: disable QUEUE when sending is done 2012-04-27 16:13:29 +02:00
ide
idle
ieee802154
infiniband A few fixes for regressions introduced in 3.4-rc1: 2012-04-26 15:35:35 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2012-04-30 10:13:48 -07:00
iommu
isdn
leds
lguest
macintosh
mca
md dm thin: fix unprotected use of prepared_discards list 2012-05-12 01:43:16 +01:00
media
memstick
message
mfd mfd: Fix build breakage in omap-usb-host.c 2012-05-01 11:55:04 +02:00
misc
mmc Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma 2012-04-26 15:33:36 -07:00
mtd Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma 2012-04-26 15:33:36 -07:00
net sungem: Fix WakeOnLan 2012-05-03 01:42:55 -04:00
nfc
nubus
of
oprofile
parisc
parport
pci Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-05-05 10:06:06 -07:00
pcmcia
pinctrl
platform Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-05-06 12:19:38 -07:00
pnp
power
pps
ps3
ptp
rapidio
regulator
remoteproc
rpmsg
rtc Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-05-04 15:35:09 -07:00
s390
sbus
scsi [SCSI] libfc: update mfs boundry checking 2012-04-25 08:46:29 +01:00
sfi
sh
sn
spi spi/spi-bfin5xx: Fix flush of last bit after each spi transfer 2012-04-27 12:20:39 -06:00
ssb
staging staging: ozwpan: Fix bug where kfree is called twice. 2012-04-26 12:40:53 -07:00
target
tc
thermal
tty TTY fix for 3.4-rc5 2012-05-02 13:47:49 -07:00
uio
usb USB: ehci-tegra: remove redundant gpio_set_value 2012-05-01 14:11:51 -04:00
uwb
vhost
video blackfin: fix compile error in bfin-lq035q1-fb.c 2012-04-26 14:46:51 -04:00
virt
virtio
vlynq
w1
watchdog hpwdt: Only BYTE reads/writes to WD Timer port 0x72 2012-04-26 14:38:07 +02:00
xen xen/acpi: Workaround broken BIOSes exporting non-existing C-states. 2012-04-26 22:07:28 -04:00
zorro
Kconfig
Makefile