android_kernel_xiaomi_sdm845/drivers
Mikulas Patocka 879129d208 dm snapshot: wait for chunks in destructor
If there are several snapshots sharing an origin and one is removed
while the origin is being written to, the snapshot's mempool may get
deleted while elements are still referenced.

Prior to dm-snapshot-use-per-device-mempools.patch the pending
exceptions may still have been referenced after the snapshot was
destroyed, but this was not a problem because the shared mempool
was still there.

This patch fixes the problem by tracking the number of mempool elements
in use.

The scenario:
- You have an origin and two snapshots 1 and 2.
- Someone writes to the origin.
- It creates two exceptions in the snapshots, snapshot 1 will be primary
exception, snapshot 2's pending_exception->primary_pe will point to the
exception in snapshot 1.
- The exceptions are being relocated, relocation of exception 1 finishes
(but it's pending_exception is still allocated, because it is referenced
by an exception from snapshot 2)
- The user lvremoves snapshot 1 --- it calls just suspend (does nothing)
and destructor. md->pending is zero (there is no I/O submitted to the
snapshot by md layer), so it won't help us.
- The destructor waits for kcopyd jobs to finish on snapshot 1 --- but
there are none.
- The destructor on snapshot 1 cleans up everything.
- The relocation of exception on snapshot 2 finishes, it drops reference
on primary_pe. This frees its primary_pe pointer. Primary_pe points to
pending exception created for snapshot 1. So it frees memory into
non-existing mempool.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2008-10-30 13:33:16 +00:00
..
accessibility
acpi ACPI suspend: build fix for ACPI_SLEEP=n && XEN_SAVE_RESTORE=y. 2008-10-25 04:07:13 -04:00
amba
ata Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev 2008-10-28 09:42:48 -07:00
atm
auxdisplay
base memory_probe: fix wrong sysfs file attribute 2008-10-20 08:52:32 -07:00
block [PATCH] sanitize blkdev_get() and friends 2008-10-21 07:49:06 -04:00
bluetooth btsdio: free sk_buff with kfree_skb 2008-10-26 23:08:48 -07:00
cdrom [PATCH] switch viocd 2008-10-21 07:48:21 -04:00
char Tidy up addresses in random drivers 2008-10-27 08:39:52 -07:00
clocksource Merge branches 'timers/clocksource', 'timers/hrtimers', 'timers/nohz', 'timers/ntp', 'timers/posixtimers' and 'timers/debug' into v28-timers-for-linus 2008-10-20 13:14:06 +02:00
connector
cpufreq
cpuidle Merge branch 'v28-range-hrtimers-for-linus-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-10-23 10:53:02 -07:00
crypto
dca device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
dio
dma Merge branch 'i7300_idle' into release 2008-10-25 04:07:44 -04:00
edac edac cell: fix incorrect edac_mode 2008-10-20 08:52:40 -07:00
eisa
firewire firewire: fw-sbp2: fix races 2008-10-26 10:27:01 +01:00
firmware x86: sysfs: kill owner field from attribute 2008-10-20 08:52:42 -07:00
gpio mfd: twl4030-gpio driver 2008-10-22 01:19:39 +02:00
gpu Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2008-10-23 10:18:40 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2008-10-26 16:34:14 -07:00
hwmon hwmon: (abituguru3) enable DMI probing feature on AW9D-MAX 2008-10-26 17:04:40 +01:00
i2c Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 2008-10-23 10:10:25 -07:00
ide arm ide breakage 2008-10-26 09:35:05 -07:00
idle i7300_idle: Cleanup based review comments 2008-10-24 12:55:14 -04:00
ieee1394 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2008-10-16 15:02:24 -07:00
infiniband Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2008-10-23 08:16:03 -07:00
input INPUT: sgi_btns: Add license specification 2008-10-27 16:18:28 +00:00
isdn device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
leds leds: da903x: fix the building failure of incomplete type of 'work' 2008-10-27 08:38:16 -07:00
lguest
macintosh device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
mca
md dm snapshot: wait for chunks in destructor 2008-10-30 13:33:16 +00:00
media V4L/DVB (9336): cx88: always de-alloc frontends on fault condition 2008-10-21 14:32:12 -02:00
memstick [PATCH] switch memstick 2008-10-21 07:48:33 -04:00
message Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-10-23 13:02:03 -07:00
mfd mfd: Make WM8400 depend on I2C until SPI is submitted 2008-10-24 18:34:39 +02:00
misc intel_menlo: fix build warning 2008-10-23 00:43:47 -04:00
mmc [PATCH] switch mmc 2008-10-21 07:48:37 -04:00
mtd [PATCH] propagate mode through open_bdev_excl/close_bdev_excl 2008-10-21 07:49:00 -04:00
net libertas: free sk_buff with kfree_skb 2008-10-26 23:09:27 -07:00
nubus nubus: fix mis-indented statement 2008-10-16 11:21:30 -07:00
of Merge commit 'kumar/kumar-for-2.6.28' 2008-10-21 15:49:55 +11:00
oprofile Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile 2008-10-23 10:05:40 -07:00
parisc [PATCH] introduce fmode_t, do annotations 2008-10-21 07:47:06 -04:00
parport 8250: Oxford Semiconductor Devices 2008-10-23 09:31:09 -07:00
pci ACPI: Oops in ACPI with git latest 2008-10-25 04:07:14 -04:00
pcmcia Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-23 08:12:21 -07:00
pnp Merge branch 'linus' into test 2008-10-23 00:11:07 -04:00
power Merge git://git.infradead.org/battery-2.6 2008-10-20 09:44:30 -07:00
ps3 ps3: Add passthru support for non-audio streams 2008-10-20 08:05:15 +02:00
rapidio
regulator
rtc Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2008-10-23 10:20:15 -07:00
s390 [S390] tape: disable interrupts in tape_open and tape_release 2008-10-28 11:12:05 +01:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-10-23 13:02:03 -07:00
serial 8250: Add more OxSemi devices 2008-10-23 09:35:18 -07:00
sh
sn
spi Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
ssb
staging staging: pcc_acpi: delete obsolete driver 2008-10-23 15:31:09 -04:00
tc
telephony phonedev: remove BKL 2008-10-20 08:52:36 -07:00
thermal
uio Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6 2008-10-20 13:42:14 -07:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2008-10-23 10:09:50 -07:00
uwb uwb: wrong sizeof argument in mac address compare 2008-10-20 14:37:53 +01:00
video Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-23 16:06:49 -07:00
virtio
w1 x86: sysfs: kill owner field from attribute 2008-10-20 08:52:42 -07:00
watchdog watchdog: Fix warning 2008-10-23 09:19:47 -07:00
xen xen: compilation fix of drivers/xen/events.c on IA64 2008-10-23 21:54:37 +02:00
zorro
Kconfig Merge branch 'master' into for-upstream 2008-10-20 16:07:19 +01:00
Makefile Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb 2008-10-26 16:35:46 -07:00