X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fdev-dax.c;h=422ea634ff1d2530b6dae4ba40747417281ee27c;hb=f89cfed7d28f76e99ee7520d6d350b9847fab07c;hp=b1f91a40f739d3f549592434d269b0c859982a50;hpb=65f655bc01502afc5bc0d1b790a176afc6c59e95;p=fio.git diff --git a/engines/dev-dax.c b/engines/dev-dax.c index b1f91a40..422ea634 100644 --- a/engines/dev-dax.c +++ b/engines/dev-dax.c @@ -157,7 +157,7 @@ static int fio_devdax_prep(struct thread_data *td, struct io_u *io_u) * It fits within existing mapping, use it */ if (io_u->offset >= fdd->devdax_off && - io_u->offset + io_u->buflen < fdd->devdax_off + fdd->devdax_sz) + io_u->offset + io_u->buflen <= fdd->devdax_off + fdd->devdax_sz) goto done; /* @@ -182,7 +182,8 @@ done: return 0; } -static int fio_devdax_queue(struct thread_data *td, struct io_u *io_u) +static enum fio_q_status fio_devdax_queue(struct thread_data *td, + struct io_u *io_u) { fio_ro_check(td, io_u); io_u->error = 0; @@ -258,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; @@ -288,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); }