diskutil: try additional slave device path if first fails
[fio.git] / diskutil.c
index 4fe554f561af20919434fcbdeef4cfd66e8dd0f9..af2fa3bdc57860755685999be12d5aba2dc83aa7 100644 (file)
@@ -3,6 +3,7 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <dirent.h>
 #include <libgen.h>
 #include <math.h>
@@ -253,6 +254,8 @@ 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.");
                        closedir(dirhandle);