linux-uconsole/drivers/md
Joe Thornber 09edef606e dm io: fix a race condition in the wake up code for sync_io
commit 10f1d5d111 upstream.

There's a race condition between the atomic_dec_and_test(&io->count)
in dec_count() and the waking of the sync_io() thread.  If the thread
is spuriously woken immediately after the decrement it may exit,
making the on stack io struct invalid, yet the dec_count could still
be using it.

Fix this race by using a completion in sync_io() and dec_count().

Reported-by: Minfei Huang <huangminfei@ucloud.cn>
Signed-off-by: Joe Thornber <thornber@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 15:58:02 -07:00
..
bcache bcache: Data corruption fix 2014-02-06 11:08:16 -08:00
persistent-data dm transaction manager: fix corruption due to non-atomic transaction commit 2014-05-13 13:59:45 +02:00
bitmap.c md: use set_bit_le and clear_bit_le 2013-04-24 11:42:41 +10:00
bitmap.h md/bitmap: record the space available for the bitmap in the superblock. 2012-05-22 13:55:34 +10:00
dm-bio-prison.c dm: add cache target 2013-03-01 22:45:51 +00:00
dm-bio-prison.h dm: add cache target 2013-03-01 22:45:51 +00:00
dm-bio-record.h
dm-bufio.c dm bufio: initialize read-only module parameters 2013-12-20 07:45:10 -08:00
dm-bufio.h dm bufio: prefetch 2012-03-28 18:41:29 +01:00
dm-builtin.c dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
dm-cache-block-types.h dm: add cache target 2013-03-01 22:45:51 +00:00
dm-cache-metadata.c dm transaction manager: fix corruption due to non-atomic transaction commit 2014-05-13 13:59:45 +02:00
dm-cache-metadata.h dm cache: policy ignore hints if generated by different version 2013-03-20 17:21:28 +00:00
dm-cache-policy-cleaner.c dm cache: policy change version from string to integer set 2013-03-20 17:21:27 +00:00
dm-cache-policy-internal.h dm cache: policy change version from string to integer set 2013-03-20 17:21:27 +00:00
dm-cache-policy-mq.c dm cache: policy change version from string to integer set 2013-03-20 17:21:27 +00:00
dm-cache-policy.c dm cache: policy change version from string to integer set 2013-03-20 17:21:27 +00:00
dm-cache-policy.h dm cache policy: fix description of lookup fn 2013-05-10 14:37:17 +01:00
dm-cache-target.c dm cache: always split discards on cache block boundaries 2014-06-11 12:03:23 -07:00
dm-crypt.c dm crypt: fix cpu hotplug crash by removing per-cpu structure 2014-06-07 13:25:39 -07:00
dm-delay.c dm delay: fix a possible deadlock due to shared workqueue 2013-12-20 07:45:11 -08:00
dm-exception-store.c dm: replace simple_strtoul 2012-07-27 15:07:59 +01:00
dm-exception-store.h
dm-flakey.c dm: rename request variables to bios 2013-03-01 22:45:47 +00:00
dm-io.c dm io: fix a race condition in the wake up code for sync_io 2014-07-17 15:58:02 -07:00
dm-ioctl.c dm ioctl: set noio flag to avoid __vmalloc deadlock 2013-08-04 16:51:02 +08:00
dm-kcopyd.c dm kcopyd: introduce configurable throttling 2013-03-01 22:45:49 +00:00
dm-linear.c dm: rename request variables to bios 2013-03-01 22:45:47 +00:00
dm-log-userspace-base.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
dm-log-userspace-transfer.c connector/userns: replace netlink uses of cap_raised() with capable() 2012-05-10 23:21:39 -04:00
dm-log-userspace-transfer.h
dm-log.c dm: use memweight() 2012-07-30 17:25:16 -07:00
dm-mpath.c dm mpath: fix stalls when handling invalid ioctls 2014-03-06 21:30:13 -08:00
dm-mpath.h
dm-path-selector.c md: Add module.h to all files using it implicitly 2011-10-31 19:31:18 -04:00
dm-path-selector.h
dm-queue-length.c dm: reject trailing characters in sccanf input 2012-03-28 18:41:26 +01:00
dm-raid.c dm-raid: silence compiler warning on rebuilds_per_group. 2013-10-05 07:13:11 -07:00
dm-raid1.c block: Use bio_sectors() more consistently 2013-03-23 14:15:30 -07:00
dm-region-hash.c dm raid1: fix crash with mirror recovery and discard 2012-07-20 14:25:03 +01:00
dm-round-robin.c dm: reject trailing characters in sccanf input 2012-03-28 18:41:26 +01:00
dm-service-time.c dm: reject trailing characters in sccanf input 2012-03-28 18:41:26 +01:00
dm-snap-persistent.c dm snapshot: fix data corruption 2013-11-04 04:31:06 -08:00
dm-snap-transient.c md: Add in export.h for files using EXPORT_SYMBOL 2011-10-31 19:31:19 -04:00
dm-snap.c dm snapshot: avoid snapshot space leak on crash 2013-12-20 07:45:10 -08:00
dm-stripe.c dm stripe: fix regression in stripe_width calculation 2013-05-10 14:37:14 +01:00
dm-sysfs.c dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
dm-table.c dm table: fail dm_table_create on dm_round_up overflow 2013-12-20 07:45:11 -08:00
dm-target.c dm: rename request variables to bios 2013-03-01 22:45:47 +00:00
dm-thin-metadata.c dm thin: avoid metadata commit if a pool's thin devices haven't changed 2014-03-06 21:30:13 -08:00
dm-thin-metadata.h dm thin: avoid metadata commit if a pool's thin devices haven't changed 2014-03-06 21:30:13 -08:00
dm-thin.c dm thin: update discard_granularity to reflect the thin-pool blocksize 2014-07-09 11:14:01 -07:00
dm-uevent.c md: Add in export.h for files using EXPORT_SYMBOL 2011-10-31 19:31:19 -04:00
dm-uevent.h
dm-verity.c dm verity: fix inability to use a few specific devices sizes 2013-08-04 16:51:02 +08:00
dm-zero.c dm: rename request variables to bios 2013-03-01 22:45:47 +00:00
dm.c dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
dm.h dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
faulty.c block: Add bio_end_sector() 2013-03-23 14:15:29 -07:00
Kconfig dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
linear.c block: Add bio_end_sector() 2013-03-23 14:15:29 -07:00
linear.h md/linear: typedef removal: linear_conf_t -> struct linear_conf 2011-10-11 16:48:54 +11:00
Makefile dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
md.c md: flush writes before starting a recovery. 2014-07-09 11:14:02 -07:00
md.h md: fix problem when adding device to read-only array with bitmap. 2014-01-25 08:27:12 -08:00
multipath.c MD: change the parameter of md thread 2012-10-11 13:34:00 +11:00
multipath.h md/multipath: typedef removal: multipath_conf_t -> struct mpconf 2011-10-11 16:48:57 +11:00
raid0.c block: Change bio_split() to respect the current value of bi_idx 2013-03-23 14:15:30 -07:00
raid0.h md: add proper merge_bvec handling to RAID0 and Linear. 2012-03-19 12:46:39 +11:00
raid1.c md/raid1: r1buf_pool_alloc: free allocate pages when subsequent allocation fails. 2014-05-30 21:52:12 -07:00
raid1.h md/raid1: prevent merging too large request 2012-07-31 10:03:53 +10:00
raid5.c md/raid5: Fix CPU hotplug callback registration 2014-02-22 12:41:29 -08:00
raid5.h md/raid5: fix interaction of 'replace' and 'recovery'. 2013-08-04 16:50:54 +08:00
raid10.c md/raid10: fix two bugs in handling of known-bad-blocks. 2014-01-25 08:27:12 -08:00
raid10.h MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 1) 2013-02-26 11:55:30 +11:00