Skip to content

Commit c04fa44

Browse files
hreineckeaxboe
authored andcommitted
block: always set partition number to '0' in blk_partition_remap()
blk_partition_remap() will only clear bi_partno if an actual remapping has happened. But flush request et al don't have an actual size, so the remapping doesn't happen and bi_partno is never cleared. So for stacked devices blk_partition_remap() will be called on each level. If (as is the case for native nvme multipathing) one of the lower-level devices do _not_support partitioning a spurious I/O error is generated. Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 84fca1b commit c04fa44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/blk-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2220,10 +2220,10 @@ static inline int blk_partition_remap(struct bio *bio)
22202220
if (bio_check_eod(bio, part_nr_sects_read(p)))
22212221
goto out;
22222222
bio->bi_iter.bi_sector += p->start_sect;
2223-
bio->bi_partno = 0;
22242223
trace_block_bio_remap(bio->bi_disk->queue, bio, part_devt(p),
22252224
bio->bi_iter.bi_sector - p->start_sect);
22262225
}
2226+
bio->bi_partno = 0;
22272227
ret = 0;
22282228
out:
22292229
rcu_read_unlock();

0 commit comments

Comments
 (0)