aboutsummaryrefslogtreecommitdiff
path: root/kernel/kexec_file.c
diff options
context:
space:
mode:
authorGuoju Fang <fangguoju@gmail.com>2019-04-25 00:48:26 +0800
committerJens Axboe <axboe@kernel.dk>2019-04-24 10:56:27 -0600
commit1568ee7e3c6305d9fbb2414bfd4b56e52853d42d (patch)
tree1d06009c00ed9357f1975120991ae6ac08f7f2c5 /kernel/kexec_file.c
parent0257c0ed5ea3de3e32cb322852c4c40bc09d1b97 (diff)
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>
Diffstat (limited to 'kernel/kexec_file.c')
0 files changed, 0 insertions, 0 deletions