summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2019-01-08 11:34:19 -0800
committerJens Axboe <axboe@kernel.dk>2019-01-08 12:47:37 -0700
commitb08e7d6b18b4a38f61800e7553cd5e5d282da4a8 (patch)
tree508a73c7ff513a6f254f02c415a21eeb82d535ae
parentfb191295af1ca14504b64ebe321e126c8019bdc3 (diff)
downloadfio-b08e7d6b18b4.tar.gz
fio-b08e7d6b18b4.tar.bz2
engines/devdax: Make detection of device-dax instances more robust
In preparation for the kernel switching device-dax instances from the "/sys/class/dax" subsystem to "/sys/bus/dax" [1], teach the device-dax instance detection to be subsystem-type agnostic. Note that the subsystem switch will require an administrator, or distro opt-in. The opt-in will either be at kernel compile time by disabling the default compatibility driver in the kernel, or at runtime with a modprobe policy to override which kernel module service device-dax devices. The daxctl utility [2] will ship a command to install the modprobe policy and include a man page that lists the potential regression risk to older FIO and other userspace tools that are hard coded to "/sys/class/dax". [1]: https://lwn.net/Articles/770128/ [2]: https://github.com/pmem/ndctl/tree/master/daxctl Reported-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--engines/dev-dax.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/dev-dax.c b/engines/dev-dax.c
index 0660bba5..422ea634 100644
--- a/engines/dev-dax.c
+++ b/engines/dev-dax.c
@@ -259,7 +259,7 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f)
{
char spath[PATH_MAX];
char npath[PATH_MAX];
- char *rpath;
+ char *rpath, *basename;
FILE *sfile;
uint64_t size;
struct stat st;
@@ -289,7 +289,8 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f)
}
/* check if DAX device */
- if (strcmp("/sys/class/dax", rpath)) {
+ basename = strrchr(rpath, '/');
+ if (!basename || strcmp("dax", basename+1)) {
log_err("%s: %s not a DAX device!\n",
td->o.name, f->file_name);
}