Skip to content

Commit

Permalink
block: fix a crash caused by wrong API
Browse files Browse the repository at this point in the history
part_stat_show takes a part device not a disk, so we should use
part_to_disk.

Fixes: d62e26b("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>
  • Loading branch information
shligit authored and axboe committed Sep 25, 2017
1 parent 332391a commit f5c156c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/partition-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f5c156c

Please sign in to comment.