linux/drivers/md/bcache
Guoju Fang c85bf62a0d 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:14:27 +02:00
..
alloc.c bcache: fix deadlock in bcache_allocator 2019-12-31 16:36:02 +01:00
bcache.h bcache: fix a lost wake-up problem caused by mca_cannibalize_lock 2020-10-01 13:14:27 +02:00
bset.c bcache: allocate meta data pages as compound pages 2020-08-21 11:05:32 +02:00
bset.h bcache: explicity type cast in bset_bkey_last() 2020-02-24 08:34:53 +01:00
btree.c bcache: fix a lost wake-up problem caused by mca_cannibalize_lock 2020-10-01 13:14:27 +02:00
btree.h
closure.c closures: fix a race on wakeup from closure_sync 2019-10-05 13:09:54 +02:00
closure.h
debug.c bcache: Fix an error code in bch_dump_read() 2020-01-27 14:51:09 +01:00
debug.h
extents.c
extents.h
io.c
journal.c bcache: allocate meta data pages as compound pages 2020-08-21 11:05:32 +02:00
journal.h
Kconfig
Makefile
movinggc.c
request.c bcache: add readahead cache policy options via sysfs interface 2020-02-11 04:34:08 -08:00
request.h
stats.c
stats.h
super.c bcache: fix a lost wake-up problem caused by mca_cannibalize_lock 2020-10-01 13:14:27 +02:00
sysfs.c bcache: add readahead cache policy options via sysfs interface 2020-02-11 04:34:08 -08:00
sysfs.h
trace.c
util.c
util.h
writeback.c bcache: fix overflow in offset_to_stripe() 2020-08-21 11:05:32 +02:00
writeback.h bcache: fix overflow in offset_to_stripe() 2020-08-21 11:05:32 +02:00