linux-stable/drivers/md
Guoju Fang 4de642e680 bcache: fix a lost wake-up problem caused by mca_cannibalize_lock
[ Upstream commit 34cf78bf34 ]

This patch fix a lost wake-up problem caused by the race between
mca_cannibalize_lock and bch_cannibalize_unlock.

Consider two processes, A and B. Process A is executing
mca_cannibalize_lock, while process B takes c->btree_cache_alloc_lock
and is executing bch_cannibalize_unlock. The problem happens that after
process A executes cmpxchg and will execute prepare_to_wait. In this
timeslice process B executes wake_up, but after that process A executes
prepare_to_wait and set the state to TASK_INTERRUPTIBLE. Then process A
goes to sleep but no one will wake up it. This problem may cause bcache
device to dead.

Signed-off-by: Guoju Fang <fangguoju@gmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:12:29 +02:00
..
bcache bcache: fix a lost wake-up problem caused by mca_cannibalize_lock 2020-10-01 13:12:29 +02:00
persistent-data dm space map common: fix to ensure new block isn't already in use 2020-02-14 16:32:13 -05:00
bitmap.c md: Avoid namespace collision with bitmap API 2020-01-29 15:02:39 +01:00
bitmap.h md: Avoid namespace collision with bitmap API 2020-01-29 15:02:39 +01:00
dm-bio-prison-v1.c dm: Use kzalloc for all structs with embedded biosets/mempools 2019-11-06 12:42:52 +01:00
dm-bio-prison-v1.h
dm-bio-prison-v2.c dm: Use kzalloc for all structs with embedded biosets/mempools 2019-11-06 12:42:52 +01:00
dm-bio-prison-v2.h
dm-bio-record.h dm bio record: save/restore bi_end_io and bi_integrity 2020-04-02 16:34:14 +02:00
dm-bufio.c Revert "dm bufio: fix deadlock with loop device" 2019-08-29 08:26:42 +02:00
dm-bufio.h
dm-builtin.c
dm-cache-background-tracker.c
dm-cache-background-tracker.h
dm-cache-block-types.h
dm-cache-metadata.c dm cache metadata: Avoid returning cmd->bm wild pointer on error 2020-09-09 19:03:12 +02:00
dm-cache-metadata.h
dm-cache-policy-internal.h
dm-cache-policy-smq.c
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c dm cache: remove all obsolete writethrough-specific code 2020-08-21 09:48:24 +02:00
dm-core.h
dm-crypt.c dm crypt: avoid truncating the logical block size 2020-06-20 10:25:19 +02:00
dm-delay.c dm delay: fix a crash when invalid device is specified 2019-05-25 18:25:33 +02:00
dm-era-target.c
dm-exception-store.c
dm-exception-store.h
dm-flakey.c dm flakey: check for null arg_name in parse_features() 2020-04-24 08:00:57 +02:00
dm-integrity.c dm integrity: fix a deadlock due to offloading to an incorrect workqueue 2020-03-11 18:03:08 +01:00
dm-io.c dm: Use kzalloc for all structs with embedded biosets/mempools 2019-11-06 12:42:52 +01:00
dm-ioctl.c dm ioctl: harden copy_params()'s copy_from_user() from malicious users 2018-11-13 11:15:10 -08:00
dm-kcopyd.c dm: Use kzalloc for all structs with embedded biosets/mempools 2019-11-06 12:42:52 +01:00
dm-linear.c dm linear: fix linear_end_io conditional definition 2018-10-18 09:16:24 +02:00
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c dm log writes: make sure super sector log updates are written in order 2019-07-03 13:16:00 +02:00
dm-log.c
dm-mpath.c dm mpath: switch paths in dm_blk_ioctl() code path 2020-06-25 15:41:48 +02:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-queue-length.c
dm-raid.c dm raid: avoid bitmap with raid4/5/6 journal device 2019-12-01 09:13:42 +01:00
dm-raid1.c
dm-region-hash.c dm: Use kzalloc for all structs with embedded biosets/mempools 2019-11-06 12:42:52 +01:00
dm-round-robin.c
dm-rq.c dm rq: don't call blk_mq_queue_stopped() in dm_stop_queue() 2020-08-21 09:48:20 +02:00
dm-rq.h
dm-service-time.c
dm-snap-persistent.c block: fix an integer overflow in logical block size 2020-01-23 08:20:30 +01:00
dm-snap-transient.c
dm-snap.c dm: Use kzalloc for all structs with embedded biosets/mempools 2019-11-06 12:42:52 +01:00
dm-stats.c
dm-stats.h
dm-stripe.c
dm-switch.c
dm-sysfs.c
dm-table.c overflow.h: Add allocation size calculation helpers 2020-09-03 11:22:33 +02:00
dm-target.c
dm-thin-metadata.c dm thin metadata: Avoid returning cmd->bm wild pointer on error 2020-09-09 19:03:12 +02:00
dm-thin-metadata.h dm thin: fix passdown_double_checking_shared_status() 2019-01-31 08:13:45 +01:00
dm-thin.c dm: Use kzalloc for all structs with embedded biosets/mempools 2019-11-06 12:42:52 +01:00
dm-uevent.c
dm-uevent.h
dm-verity-fec.c dm verity fec: fix hash block number in verity_fec_decode 2020-05-05 19:15:50 +02:00
dm-verity-fec.h
dm-verity-target.c dm verity: use message limit for data block corruption message 2019-07-21 09:04:40 +02:00
dm-verity.h
dm-zero.c
dm-zoned-metadata.c dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone 2020-06-25 15:41:54 +02:00
dm-zoned-reclaim.c dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone 2020-06-25 15:41:54 +02:00
dm-zoned-target.c dm zoned: assign max_io_len correctly 2020-07-09 09:36:33 +02:00
dm-zoned.h dm zoned: reduce overhead of backing device checks 2019-12-17 20:39:25 +01:00
dm.c dm: use noio when sending kobject event 2020-07-22 09:22:19 +02:00
dm.h
faulty.c
Kconfig
linear.c
linear.h
Makefile
md-cluster.c md-cluster: fix wild pointer of unlock_all_bitmaps() 2020-08-21 09:48:04 +02:00
md-cluster.h
md.c md: add feature flag MD_FEATURE_RAID0_LAYOUT 2020-06-25 15:42:02 +02:00
md.h md: don't report active array_state until after revalidate_disk() completes. 2019-10-05 12:48:10 +02:00
multipath.c
multipath.h
raid0.c md: add feature flag MD_FEATURE_RAID0_LAYOUT 2020-06-25 15:42:02 +02:00
raid0.h md/raid0: avoid RAID0 data corruption due to layout confusion. 2019-10-05 12:48:13 +02:00
raid1-10.c
raid1.c md: raid1: check rdev before reference in raid1_sync_request func 2020-01-09 10:17:52 +01:00
raid1.h
raid5-cache.c md/raid5: fix 'out of memory' during raid cache recovery 2019-02-06 17:31:37 +01:00
raid5-log.h md/raid5-cache: disable reshape completely 2018-10-10 08:54:20 +02:00
raid5-ppl.c
raid5.c md/raid5: Fix Force reconstruct-write io stuck in degraded raid5 2020-08-21 09:48:18 +02:00
raid5.h
raid10.c md/raid10: prevent access of uninitialized resync_pages offset 2019-12-01 09:14:17 +01:00
raid10.h