Mikulas Patocka
340cd44451
dm kcopyd: fix callback race
...
If the thread calling dm_kcopyd_copy is delayed due to scheduling inside
split_job/segment_complete and the subjobs complete before the loop in
split_job completes, the kcopyd callback could be invoked from the
thread that called dm_kcopyd_copy instead of the kcopyd workqueue.
dm_kcopyd_copy -> split_job -> segment_complete -> job->fn()
Snapshots depend on the fact that callbacks are called from the singlethreaded
kcopyd workqueue and expect that there is no racing between individual
callbacks. The racing between callbacks can lead to corruption of exception
store and it can also mean that exception store callbacks are called twice
for the same exception - a likely reason for crashes reported inside
pending_complete() / remove_exception().
This patch fixes two problems:
1. job->fn being called from the thread that submitted the job (see above).
- Fix: hand over the completion callback to the kcopyd thread.
2. job->fn(read_err, write_err, job->context); in segment_complete
reports the error of the last subjob, not the union of all errors.
- Fix: pass job->write_err to the callback to report all error bits
(it is done already in run_complete_job)
Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2009-04-09 00:27:17 +01:00
..
accessibility
acpi
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
2009-04-07 11:24:19 -07:00
amba
ata
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
2009-04-07 08:53:02 -07:00
atm
dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
2009-04-07 08:31:11 -07:00
auxdisplay
base
dma-mapping: replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24)
2009-04-07 08:31:12 -07:00
block
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
2009-04-07 11:06:41 -07:00
bluetooth
cdrom
char
esp: fix section mismatch warning
2009-04-07 08:31:03 -07:00
clocksource
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
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
Merge branch 'linus' into release
2009-04-05 02:14:15 -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
Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
2009-04-07 08:44:43 -07:00
i2c
i2c: imx: Make disable_delay a per-device variable
2009-04-07 10:23:34 +01:00
ide
dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
2009-04-07 08:31:11 -07: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
dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
2009-04-07 08:31:11 -07:00
input
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
2009-04-05 11:15:54 -07:00
isdn
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
2009-04-06 18:05:43 -07:00
leds
leds: introduce lp5521 led driver
2009-04-06 16:06:27 +01:00
lguest
macintosh
mca
md
dm kcopyd: fix callback race
2009-04-09 00:27:17 +01:00
media
dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
2009-04-07 08:31:11 -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
dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
2009-04-07 08:31:11 -07:00
mfd
mfd: fix da903x warning
2009-04-05 00:32:25 +02:00
misc
dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
2009-04-07 08:31:11 -07:00
mmc
dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
2009-04-07 08:31:11 -07:00
mtd
Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6
2009-04-06 15:00:00 -07:00
net
dma-mapping: replace all DMA_28BIT_MASK macro with DMA_BIT_MASK(28)
2009-04-07 08:31:12 -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
parport: Use the PCI IRQ if offered
2009-04-07 08:44:06 -07:00
pci
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
2009-04-07 11:24:19 -07:00
pcmcia
platform
Merge branch 'linus' into release
2009-04-05 02:14:15 -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 branch 'linus' into release
2009-04-05 02:14:15 -04: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
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
2009-04-05 11:15:54 -07:00
s390
sbus
scsi
dma-mapping: replace all DMA_31BIT_MASK macro with DMA_BIT_MASK(31)
2009-04-07 08:31:11 -07:00
serial
tty: jsm cleanups
2009-04-07 08:44:06 -07:00
sh
sn
dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)
2009-04-07 08:31:10 -07:00
spi
spi_imx: set spi_master.dma_alignment = 4
2009-04-07 08:31:07 -07:00
ssb
staging
serqt: initial clean up pass for tty side
2009-04-07 08:44:05 -07:00
tc
telephony
thermal
uio
usb
dma-mapping: replace all DMA_31BIT_MASK macro with DMA_BIT_MASK(31)
2009-04-07 08:31:11 -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
fbdev: i.MX31: fix panning, error handling, clean up
2009-04-07 08:31:09 -07:00
virtio
w1
mfd: remove DS1WM clock handling
2009-04-05 00:32:22 +02:00
watchdog
powerpc/wdrtas: Update wdrtas_get_interval to use rtas_data_buf
2009-04-07 15:07:43 +10:00
xen
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask
2009-04-05 10:33:07 -07:00
zorro
Kconfig
Makefile