linux-stable/drivers
Milan Broz 14f2793958 loop: Flush possible running bios when loop device is released.
When there are still queued bios and reference count
drops to zero, loop device must flush all queued bios.

Otherwise it can lead to situation that caller
closes the device, but some bios are still running
and endio() function call later OOpses when uses
unallocated mempool.

This happens for example when running dm-crypt over loop,
here is typical oops backtrace:

 Oops: 0000 [#1] PREEMPT SMP
 EIP is at mempool_free+0x12/0x6b
...
 crypt_dec_pending+0x50/0x54 [dm_crypt]
 crypt_endio+0x9f/0xa7 [dm_crypt]
 crypt_endio+0x0/0xa7 [dm_crypt]
 bio_endio+0x2b/0x2e
 loop_thread+0x37a/0x3b1
 do_lo_send_aops+0x0/0x165
 autoremove_wake_function+0x0/0x33
 loop_thread+0x0/0x3b1
 kthread+0x3b/0x61
 kthread+0x0/0x61
 kernel_thread_helper+0x7/0x10

(But crash is reproducible with different dm targets
running over loop device too.)

Patch fixes it by flushing the bios in release call,
reusing the flush mechanism for switching backing store.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-12-29 08:29:52 +01:00
..
accessibility
acpi Merge branches 'tracing/ftrace', 'tracing/hw-branch-tracing' and 'tracing/ring-buffer'; commit 'v2.6.28' into tracing/core 2008-12-25 13:11:00 +01:00
amba
ata powerpc/mpc5200: Add MDMA/UDMA support to MPC5200 ATA driver 2008-12-21 02:54:29 -07:00
atm atm: Driver for Solos PCI ADSL2+ card. 2008-12-26 01:26:11 -08:00
auxdisplay
base
block loop: Flush possible running bios when loop device is released. 2008-12-29 08:29:52 +01:00
bluetooth
cdrom cdrom: reduce stack usage of mmc_ioctl_dvd_read_struct 2008-12-29 08:28:43 +01:00
char Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-12-28 16:54:33 -08:00
clocksource
connector
cpufreq
cpuidle
crypto crypto: talitos - Ack done interrupt in isr instead of tasklet 2008-12-25 11:02:33 +11:00
dca
dio
dma
edac Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-12-28 16:54:33 -08:00
eisa
firewire
firmware Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
gpio
gpu drm/radeon: fix correctness of irq_enabled check for radeon. 2008-12-23 10:50:12 +10:00
hid
hwmon
i2c sh: sh_mobile i2c clock framework support 2008-12-22 18:42:51 +09:00
ide m68k: machw.h cleanup 2008-12-28 20:00:03 +01:00
idle
ieee1394 ieee1394: add quirk fix for Freecom HDD 2008-12-14 01:13:13 +01:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
input sh: sh_mobile keysc clock framework support 2008-12-22 18:42:51 +09:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
leds
lguest
macintosh Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-12-28 16:54:33 -08:00
mca
md bio: allow individual slabs in the bio_set 2008-12-29 08:29:23 +01:00
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
memstick
message Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
mfd
misc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
mmc
mtd
net Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-12-28 16:54:33 -08:00
nubus
of of/gpio: Implement of_gpio_count() 2008-12-21 14:21:14 +11:00
oprofile
parisc
parport
pci Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-12-28 16:54:33 -08:00
pcmcia pcmcia: blackfin: fix bug - add missing ; to MODULE macro 2008-12-15 16:27:06 -08:00
pnp
power
ps3
rapidio rapidio: struct device - replace bus_id with dev_name(), dev_set_name() 2008-12-16 15:53:41 +11:00
regulator
rtc rtc: rtc-isl1208: reject invalid dates 2008-12-23 15:58:21 -08:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
sbus
scsi Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2008-12-28 12:54:07 -08:00
serial Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-12-28 16:54:33 -08:00
sh sh: maple: Do not pass SLAB_POISON to kmem_cache_create() 2008-12-16 16:40:32 +09:00
sn
spi
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
tc
telephony
thermal
uio
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
uwb
video Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-12-28 16:54:33 -08:00
virtio
w1 w1: fix slave selection on big-endian systems 2008-12-23 15:58:21 -08:00
watchdog
xen xen: clean up asm/xen/hypervisor.h 2008-12-16 21:50:31 +01:00
zorro
Kconfig
Makefile