path: root/block/partition-generic.c
diff options
authorJiufei Xue <>2018-02-27 20:10:18 +0800
committerJens Axboe <>2018-03-01 08:41:25 -0700
commit9c0fb1e313aaf4e8edec22433c8b22dd308e466c (patch)
tree8547474277534911851c0370b417b86ba1b39aac /block/partition-generic.c
parent7c5a0dcf557c6511a61e092ba887de28882fe857 (diff)
block: display the correct diskname for bio
bio_devname use __bdevname to display the device name, and can only show the major and minor of the part0, Fix this by using disk_name to display the correct name. Fixes: 74d46992e0d9 ("block: replace bi_bdev with a gendisk pointer and partitions index") Reviewed-by: Omar Sandoval <> Reviewed-by: Christoph Hellwig <> Signed-off-by: Jiufei Xue <> Signed-off-by: Jens Axboe <>
Diffstat (limited to 'block/partition-generic.c')
1 files changed, 6 insertions, 0 deletions
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 91622db..08dabcd 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -51,6 +51,12 @@ const char *bdevname(struct block_device *bdev, char *buf)
+const char *bio_devname(struct bio *bio, char *buf)
+ return disk_name(bio->bi_disk, bio->bi_partno, buf);
* There's very little reason to use this, you should really
* have a struct block_device just about everywhere and use