mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
bcache: use bio_set_dev to assign ->bi_bdev
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>
This commit is contained in:
parent
a7c7f7b2b6
commit
f65b95fe0c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user