additional ->bi_bdev fixups
Subsystems (3)
Christoph Hellwig
maintainerHi Jens,
more fixes for the (so far theoretical) fallout from the ->bi_bdev conversion.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerPATCH 1/3 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.
--- drivers/nvme/host/core.c | 2 +- drivers/nvme/host/lightnvm.c | 2 +- drivers/nvme/host/multipath.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/nvme/host/core.c +1 -1
@@ -1133,7 +1133,7 @@ static int nvme_submit_user_cmd(struct request_queue *q,if (ret) goto out; bio = req->bio; - bio->bi_bdev = bdev; +bio_set_dev (bio, bdev);if (bdev && meta_buffer && meta_len) { meta =nvme_add_user_metadata (bio, meta_buffer, meta_len, meta_seed, write);
drivers/nvme/host/lightnvm.c +1 -1
@@ -816,7 +816,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q, 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 );
drivers/nvme/host/multipath.c +2 -2
@@ -312,7 +312,7 @@ blk_qc_t nvme_ns_head_submit_bio(struct bio *bio) srcu_idx =srcu_read_lock (&head->srcu); ns =nvme_find_path (head);if (likely (ns)) { - bio->bi_bdev = ns->disk->part0; +bio_set_dev (bio, ns->disk->part0); bio->bi_opf |=REQ_NVME_MPATH ;trace_block_bio_remap (bio,disk_devt (ns->head->disk), bio->bi_iter.bi_sector);
@@ -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 * path. */ - bio->bi_bdev = head->disk->part0; +bio_set_dev (bio, head->disk->part0);submit_bio_noacct (bio); } }
Signature · 7 lines
2.29.2 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerPATCH 2/3 bcache: use bio_set_dev to assign ->bi_bdev
In reply to Christoph HellwigAlways use the bio_set_dev helper to assign ->bi_bdev to make sure other state related to the device is uptodate.
--- drivers/md/bcache/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/debug.c +1 -1
@@ -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;
Signature · 7 lines
2.29.2 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH 2/3] bcache: use bio_set_dev to assign ->bi_bdev
Quoted 4 lines · Christoph Hellwig
Always use the
bio_set_devhelper to assign ->bi_bdev to make sure other state related to the device is uptodate.Signed-off-by Christoph Hellwig <[email protected]>
Coly Li
Quoted 10 lines
--- drivers/md/bcache/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/md/bcache/debug.c +0
-0
drivers/md/bcache/debug.c void bch_data_verify(struct cached_dev *dc, struct bio *bio) · line 120
Quoted 8 lines
drivers/md/bcache/debug.c +1
-1@@ -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;
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerPATCH 3/3 block: inherit BIO_REMAPPED when cloning bios
In reply to Christoph HellwigCloned bios are can be used to on the same device, in which case we need to inherit the BIO_REMAPPED flag to avoid a double partition remap. When the cloned bios are used on another device, bio_set_dev will clear the flag.
--- block/bio.c | 2 ++ block/blk-crypto-fallback.c | 2 ++ block/bounce.c | 2 ++ 3 files changed, 6 insertions(+)
block/bio.c +2 -0
@@ -666,6 +666,8 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src)bio_set_flag (bio,BIO_CLONED );if (bio_flagged (bio_src,BIO_THROTTLED ))bio_set_flag (bio,BIO_THROTTLED ); +if (bio_flagged (bio_src,BIO_REMAPPED )) +bio_set_flag (bio,BIO_REMAPPED ); bio->bi_opf = bio_src->bi_opf; bio->bi_ioprio = bio_src->bi_ioprio; bio->bi_write_hint = bio_src->bi_write_hint;
block/blk-crypto-fallback.c +2 -0
@@ -168,6 +168,8 @@ static struct bio *blk_crypto_clone_bio(struct bio *bio_src)if (!bio)return NULL ; bio->bi_bdev = bio_src->bi_bdev; +if (bio_flagged (bio_src,BIO_REMAPPED )) +bio_set_flag (bio,BIO_REMAPPED ); bio->bi_opf = bio_src->bi_opf; bio->bi_ioprio = bio_src->bi_ioprio; bio->bi_write_hint = bio_src->bi_write_hint;
block/bounce.c +2 -0
@@ -247,6 +247,8 @@ static struct bio *bounce_clone_bio(struct bio *bio_src, gfp_t gfp_mask,if (!bio)return NULL ; bio->bi_bdev = bio_src->bi_bdev; +if (bio_flagged (bio_src,BIO_REMAPPED )) +bio_set_flag (bio,BIO_REMAPPED ); bio->bi_opf = bio_src->bi_opf; bio->bi_ioprio = bio_src->bi_ioprio; bio->bi_write_hint = bio_src->bi_write_hint;
Signature · 7 lines
2.29.2 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 4 lines · Christoph Hellwig
Hi Jens,
more fixes for the (so far theoretical) fallout from the ->bi_bdev conversion.
Applied, thanks.
Signature · 7 lines
Jens Axboe _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme