]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: fix wrong bdev parameter when calling bio_alloc_clone() in do_bio_hook()
authorColy Li <colyli@suse.de>
Tue, 19 Apr 2022 16:04:25 +0000 (00:04 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Apr 2022 17:28:17 +0000 (11:28 -0600)
commit92b3fa81eb9f8531f7898c26e819a07487242fa7
tree2106b6fb16c0551c970064b0707be780c7577613
parentb0654c74814162e8e3f67126dea801b6167dd3c7
bcache: fix wrong bdev parameter when calling bio_alloc_clone() in do_bio_hook()

Commit d1e3f456238c ("block: pass a block_device to bio_clone_fast")
calls the modified bio_alloc_clone() in bcache code as:
bio_init_clone(bio->bi_bdev, bio, orig_bio, GFP_NOIO);

But the first parameter is wrong, where bio->bi_bdev should be
orig_bio->bi_bdev. The wrong bi_bdev panics the kernel when submitting
cache bio.

This patch fixes the wrong bdev parameter usage and avoid the panic.

Fixes: d1e3f456238c ("block: pass a block_device to bio_clone_fast")
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Mike Snitzer <snitzer@redhat.com>
Link: https://lore.kernel.org/r/20220419160425.4148-3-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/request.c