summaryrefslogtreecommitdiffstats
path: root/block/partition-generic.c
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2017-09-21 21:17:16 +0200
committerJens Axboe <axboe@kernel.dk>2017-09-25 16:56:05 +0200
commitf5c156c4c29a3d87176dd6e5c099388e187ec29b (patch)
tree622e290bba59c70440b761655fe430c884f04c34 /block/partition-generic.c
parentfs: Fix page cache inconsistency when mixing buffered and AIO DIO (diff)
downloadlinux-f5c156c4c29a3d87176dd6e5c099388e187ec29b.tar.xz
linux-f5c156c4c29a3d87176dd6e5c099388e187ec29b.zip
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 <bart.vanassche@wdc.com> Cc: Omar Sandoval <osandov@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--block/partition-generic.c2
1 files changed, 1 insertions, 1 deletions
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;