block: fix a crash caused by wrong API
authorShaohua Li <[email protected]>
Thu, 21 Sep 2017 19:17:16 +0000 (12:17 -0700)
committerJens Axboe <[email protected]>
Mon, 25 Sep 2017 14:56:05 +0000 (08:56 -0600)
part_stat_show takes a part device not a disk, so we should use
part_to_disk.

Fixes: d62e26b3ffd2("block: pass in queue to inflight accounting")
Cc: Bart Van Assche <[email protected]>
Cc: Omar Sandoval <[email protected]>
Signed-off-by: Shaohua Li <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
block/partition-generic.c

index 86e8fe1adcdb7f1b10fd5acd8f5c36f712736971..88c555db4e5deee60d852b78b70a20589cc2813f 100644 (file)
@@ -112,7 +112,7 @@ ssize_t part_stat_show(struct device *dev,
                       struct device_attribute *attr, char *buf)
 {
        struct hd_struct *p = dev_to_part(dev);
-       struct request_queue *q = dev_to_disk(dev)->queue;
+       struct request_queue *q = part_to_disk(p)->queue;
        unsigned int inflight[2];
        int cpu;