Merge branch 'mpath_nvme_diskutil' of https://github.com/sitsofe/fio
authorJens Axboe <axboe@kernel.dk>
Fri, 2 Mar 2018 19:02:08 +0000 (12:02 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 2 Mar 2018 19:02:08 +0000 (12:02 -0700)
* 'mpath_nvme_diskutil' of https://github.com/sitsofe/fio:
  diskutil: minor style cleanup
  diskutil: try additional slave device path if first fails

diskutil.c

index 618cae8b54f4c3138f55f2ea537e0b9b6ed12a69..789071d197fcd2a4bd2abd9dfc01c1ae4235e954 100644 (file)
@@ -246,7 +246,7 @@ static void find_add_disk_slaves(struct thread_data *td, char *path,
                 * devices?
                 */
                linklen = readlink(temppath, slavepath, PATH_MAX - 1);
-               if (linklen  < 0) {
+               if (linklen < 0) {
                        perror("readlink() for slave device.");
                        closedir(dirhandle);
                        return;
@@ -254,8 +254,10 @@ static void find_add_disk_slaves(struct thread_data *td, char *path,
                slavepath[linklen] = '\0';
 
                sprintf(temppath, "%s/%s/dev", slavesdir, slavepath);
+               if (access(temppath, F_OK) != 0)
+                       sprintf(temppath, "%s/%s/device/dev", slavesdir, slavepath);
                if (read_block_dev_entry(temppath, &majdev, &mindev)) {
-                       perror("Error getting slave device numbers.");
+                       perror("Error getting slave device numbers");
                        closedir(dirhandle);
                        return;
                }