From 783aab988a37d409324a0bac9552234a1c8ee3f7 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 20 Jul 2019 10:42:48 +0200 Subject: [PATCH] iostat: Use the right major and minor numbers to read partitions stats Signed-off-by: Sebastien GODARD --- iostat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iostat.c b/iostat.c index 153462f..a54c3f8 100644 --- a/iostat.c +++ b/iostat.c @@ -526,7 +526,7 @@ int read_sysfs_part_stat(int curr, struct io_device *d) /* Read stats for device */ snprintf(dfile, sizeof(dfile), "%s/%d:%d/%s", - SYSFS_DEV_BLOCK, major, minor, S_STAT); + SYSFS_DEV_BLOCK, d->major, d->minor, S_STAT); dfile[sizeof(dfile) - 1] = '\0'; return read_sysfs_file_stat(dfile, d->dev_stats[curr]); @@ -548,7 +548,7 @@ void read_sysfs_dlist_stat(int curr) for (dlist = dev_list; dlist != NULL; dlist = dlist->next) { if (dlist->exist) - /* Device statis already read */ + /* Device stats already read */ continue; else if (dlist->dev_tp == T_PART) { -- 2.40.0