]> git.baikalelectronics.ru Git - kernel.git/commitdiff
bcache: use bio_set_dev to assign ->bi_bdev
authorChristoph Hellwig <hch@lst.de>
Tue, 26 Jan 2021 14:33:07 +0000 (15:33 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Jan 2021 15:50:01 +0000 (08:50 -0700)
Always use the bio_set_dev helper to assign ->bi_bdev to make sure
other state related to the device is uptodate.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/debug.c

index 058dd80144281eadabe14dbb3afe942192d62da9..63e809f38e3f513d9e090b2f84d241767b89a832 100644 (file)
@@ -114,7 +114,7 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio)
        check = bio_kmalloc(GFP_NOIO, bio_segments(bio));
        if (!check)
                return;
-       check->bi_bdev = bio->bi_bdev;
+       bio_set_dev(check, bio->bi_bdev);
        check->bi_opf = REQ_OP_READ;
        check->bi_iter.bi_sector = bio->bi_iter.bi_sector;
        check->bi_iter.bi_size = bio->bi_iter.bi_size;