linux/drivers/md/bcache
Guoju Fang fd3572bd5b 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:17:18 +02:00
..
Kconfig
Makefile
alloc.c
bcache.h bcache: fix a lost wake-up problem caused by mca_cannibalize_lock 2020-10-01 13:17:18 +02:00
bset.c
bset.h
btree.c bcache: fix a lost wake-up problem caused by mca_cannibalize_lock 2020-10-01 13:17:18 +02:00
btree.h
closure.c
closure.h
debug.c
debug.h
extents.c
extents.h
io.c
journal.c
journal.h
movinggc.c
request.c
request.h
stats.c
stats.h
super.c bcache: fix a lost wake-up problem caused by mca_cannibalize_lock 2020-10-01 13:17:18 +02:00
sysfs.c
sysfs.h
trace.c
util.c
util.h
writeback.c bcache: fix overflow in offset_to_stripe() 2020-08-21 13:05:25 +02:00
writeback.h bcache: fix overflow in offset_to_stripe() 2020-08-21 13:05:25 +02:00