Bug fix: handles disk device used multiple times
authorAlan D. Brunelle <alan.brunelle@hp.com>
Fri, 11 Sep 2009 18:57:10 +0000 (14:57 -0400)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 11 Sep 2009 19:34:33 +0000 (21:34 +0200)
There were issues in having the same underlying device being referenced
multiple times (via different paths) when reporting storage I/O
statistics. As an example: having two (or more) LVM2/DM volumes crafted
out of the same MD array.

This patch simply skips over any devices previously seen.

Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diskutil.c

index cb15882ffe7b696cb505122d41e44aad14ac0d9b..62149d915558713554a40e801bcda7d38b219472 100644 (file)
@@ -221,6 +221,13 @@ static void find_add_disk_slaves(struct thread_data *td, char *path,
                        return;
                }
 
+               /*
+                * See if this maj,min already exists
+                */
+               slavedu = disk_util_exists(majdev, mindev);
+               if (slavedu)
+                       continue;
+
                sprintf(temppath, "%s/%s", slavesdir, slavepath);
                __init_per_file_disk_util(td, majdev, mindev, temppath);
                slavedu = disk_util_exists(majdev, mindev);