VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Christoph Hellwig <hch@lst.de> 2021-01-24 11:02:36 +0100 committer: Jens Axboe <axboe@kernel.dk> 2021-01-24 18:17:20 -0700 commit: 30c5d3456c272f0de0d7e7eb9fc355fa64a5f649 parent: 2f9f6221b9b9944e96c80455b469a6f0269c558b
Commit Summary:
block: do not reassig ->bi_bdev when partition remapping
Diffstat:
1 file changed, 3 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 64f69022de96..1c1b97a82caa 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -752,7 +752,7 @@ static int blk_partition_remap(struct bio *bio)
 				      bio->bi_iter.bi_sector -
 				      p->bd_start_sect);
 	}
-	bio->bi_bdev = bdev_whole(p);
+	bio_set_flag(bio, BIO_REMAPPED);
 	return 0;
 }
 
@@ -817,7 +817,8 @@ static noinline_for_stack bool submit_bio_checks(struct bio *bio)
 		goto end_io;
 	if (unlikely(bio_check_eod(bio)))
 		goto end_io;
-	if (bio->bi_bdev->bd_partno && unlikely(blk_partition_remap(bio)))
+	if (bio->bi_bdev->bd_partno && !bio_flagged(bio, BIO_REMAPPED) &&
+	    unlikely(blk_partition_remap(bio)))
 		goto end_io;
 
 	/*