From: Shaohua Li Date: Thu, 21 Sep 2017 19:17:16 +0000 (-0700) Subject: block: fix a crash caused by wrong API X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f5c156c4c29a3d87176dd6e5c099388e187ec29b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git block: fix a crash caused by wrong API 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 Cc: Omar Sandoval Signed-off-by: Shaohua Li Signed-off-by: Jens Axboe --- diff --git a/block/partition-generic.c b/block/partition-generic.c index 86e8fe1adcdb..88c555db4e5d 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -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;