Commit a7c7f7b2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

nvme: 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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a5bf0a92
...@@ -1133,7 +1133,7 @@ static int nvme_submit_user_cmd(struct request_queue *q, ...@@ -1133,7 +1133,7 @@ static int nvme_submit_user_cmd(struct request_queue *q,
if (ret) if (ret)
goto out; goto out;
bio = req->bio; bio = req->bio;
bio->bi_bdev = bdev; bio_set_dev(bio, bdev);
if (bdev && meta_buffer && meta_len) { if (bdev && meta_buffer && meta_len) {
meta = nvme_add_user_metadata(bio, meta_buffer, meta_len, meta = nvme_add_user_metadata(bio, meta_buffer, meta_len,
meta_seed, write); meta_seed, write);
......
...@@ -816,7 +816,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q, ...@@ -816,7 +816,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q,
vcmd->ph_rw.metadata = cpu_to_le64(metadata_dma); vcmd->ph_rw.metadata = cpu_to_le64(metadata_dma);
} }
bio->bi_bdev = ns->disk->part0; bio_set_dev(bio, ns->disk->part0);
} }
blk_execute_rq(NULL, rq, 0); blk_execute_rq(NULL, rq, 0);
......
...@@ -312,7 +312,7 @@ blk_qc_t nvme_ns_head_submit_bio(struct bio *bio) ...@@ -312,7 +312,7 @@ blk_qc_t nvme_ns_head_submit_bio(struct bio *bio)
srcu_idx = srcu_read_lock(&head->srcu); srcu_idx = srcu_read_lock(&head->srcu);
ns = nvme_find_path(head); ns = nvme_find_path(head);
if (likely(ns)) { if (likely(ns)) {
bio->bi_bdev = ns->disk->part0; bio_set_dev(bio, ns->disk->part0);
bio->bi_opf |= REQ_NVME_MPATH; bio->bi_opf |= REQ_NVME_MPATH;
trace_block_bio_remap(bio, disk_devt(ns->head->disk), trace_block_bio_remap(bio, disk_devt(ns->head->disk),
bio->bi_iter.bi_sector); bio->bi_iter.bi_sector);
...@@ -352,7 +352,7 @@ static void nvme_requeue_work(struct work_struct *work) ...@@ -352,7 +352,7 @@ static void nvme_requeue_work(struct work_struct *work)
* Reset disk to the mpath node and resubmit to select a new * Reset disk to the mpath node and resubmit to select a new
* path. * path.
*/ */
bio->bi_bdev = head->disk->part0; bio_set_dev(bio, head->disk->part0);
submit_bio_noacct(bio); submit_bio_noacct(bio);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment