diskutil: try additional slave device path if first fails
authorPotnuri Bharat Teja <bharat@chelsio.com>
Fri, 2 Mar 2018 15:26:01 +0000 (15:26 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Fri, 2 Mar 2018 18:00:17 +0000 (18:00 +0000)
Running fio on an NVMEoF device with multipath slaves fails with a "No
such file or directory" error when displaying disk stats. Correct this
by using a different path to the sysfs slave device.

[sitsofe: change new path to be a fallback when regular path fails]

Fixes: https://github.com/axboe/fio/issues/525
Closes: https://github.com/axboe/fio/pull/526

Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
diskutil.c

index 618cae8b54f4c3138f55f2ea537e0b9b6ed12a69..af2fa3bdc57860755685999be12d5aba2dc83aa7 100644 (file)
@@ -254,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);