linux/drivers/md/bcache
Guoju Fang 1568ee7e3c bcache: fix crashes stopping bcache device before read miss done
The bio from upper layer is considered completed when bio_complete()
returns. In most scenarios bio_complete() is called in search_free(),
but when read miss happens, the bio_compete() is called when backing
device reading completed, while the struct search is still in use until
cache inserting finished.

If someone stops the bcache device just then, the device may be closed
and released, but after cache inserting finished the struct search will
access a freed struct cached_dev.

This patch add the reference of bcache device before bio_complete() when
read miss happens, and put it after the search is not used.

Signed-off-by: Guoju Fang <fangguoju@gmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-24 10:56:27 -06:00
..
alloc.c bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_alloc_set 2018-10-08 08:19:56 -06:00
bcache.h bcache: option to automatically run gc thread after writeback 2018-12-13 08:15:54 -07:00
bset.c bcache: fix code comments style 2018-08-11 15:46:42 -06:00
bset.h bcache: style fixes for lines over 80 characters 2018-08-11 15:46:41 -06:00
btree.c block: allow bio_for_each_segment_all() to iterate over multi-page bvec 2019-02-15 08:40:11 -07:00
btree.h bcache: introduce force_wake_up_gc() 2018-12-13 08:15:54 -07:00
closure.c bcache: add missing SPDX header 2018-08-11 15:46:42 -06:00
closure.h bcache: fix typo in code comments of closure_return_with_destructor() 2018-10-08 08:19:43 -06:00
debug.c bcache: do not check if debug dentry is ERR or NULL explicitly on remove 2018-12-13 08:15:54 -07:00
debug.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
extents.c bcache: treat stale && dirty keys as bad keys 2019-02-09 07:18:31 -07:00
extents.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
io.c bcache: fix typo 'succesfully' to 'successfully' 2018-08-11 15:46:42 -06:00
journal.c bcache: print number of keys in trace_bcache_journal_write 2018-12-13 08:15:54 -07:00
journal.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
Kconfig for-4.19/post-20180822 2018-08-22 13:38:05 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
movinggc.c bcache: style fix to add a blank line after declarations 2018-08-11 15:46:41 -06:00
request.c bcache: fix crashes stopping bcache device before read miss done 2019-04-24 10:56:27 -06:00
request.h bcache: remove unused bch_passthrough_cache 2018-10-08 08:19:52 -06:00
stats.c bcache: not use hard coded memset size in bch_cache_accounting_clear() 2019-02-09 07:18:31 -07:00
stats.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
super.c bcache: fix indentation issue, remove tabs on a hunk of code 2019-02-09 07:18:31 -07:00
sysfs.c bcache: fix input overflow to cache set sysfs file io_error_halflife 2019-02-09 07:18:33 -07:00
sysfs.h bcache: add sysfs_strtoul_bool() for setting bit-field variables 2019-02-09 07:18:32 -07:00
trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
util.c bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages() 2019-02-15 08:40:11 -07:00
util.h for-4.19/post-20180822 2018-08-22 13:38:05 -07:00
writeback.c bcache: option to automatically run gc thread after writeback 2018-12-13 08:15:54 -07:00
writeback.h bcache: never writeback a discard operation 2019-02-09 07:18:31 -07:00