From: Potnuri Bharat Teja Date: Fri, 2 Mar 2018 15:26:01 +0000 (+0000) Subject: diskutil: try additional slave device path if first fails X-Git-Tag: fio-3.6~61^2~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=75d5519d53604946298967e963c6f849a3a7ad6c;ds=sidebyside diskutil: try additional slave device path if first fails 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 Signed-off-by: Sitsofe Wheeler --- diff --git a/diskutil.c b/diskutil.c index 618cae8b..af2fa3bd 100644 --- a/diskutil.c +++ b/diskutil.c @@ -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);