From 75d5519d53604946298967e963c6f849a3a7ad6c Mon Sep 17 00:00:00 2001 From: Potnuri Bharat Teja Date: Fri, 2 Mar 2018 15:26:01 +0000 Subject: [PATCH] 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 --- diskutil.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.25.1