X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=filesetup.c;h=634d556e9107420fa1b57acfbccb56b6d0766fca;hb=ee92054faa594769a9c2afbaec9683f8fc508986;hp=881aeee8f8bf2b94649046181d9892d7050face8;hpb=0ff8ad2e50052293c74254bb52c95de8ab2b1d90;p=fio.git diff --git a/filesetup.c b/filesetup.c index 881aeee8..634d556e 100644 --- a/filesetup.c +++ b/filesetup.c @@ -413,7 +413,19 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, else if (f->filetype == FIO_TYPE_FILE) ret = posix_fadvise(f->fd, off, len, POSIX_FADV_DONTNEED); else if (f->filetype == FIO_TYPE_BD) { + int retry_count = 0; + ret = blockdev_invalidate_cache(f); + while (ret < 0 && errno == EAGAIN && retry_count++ < 25) { + /* + * Linux multipath devices reject ioctl while + * the maps are being updated. That window can + * last tens of milliseconds; we'll try up to + * a quarter of a second. + */ + usleep(10000); + ret = blockdev_invalidate_cache(f); + } if (ret < 0 && errno == EACCES && geteuid()) { if (!root_warn) { log_err("fio: only root may flush block " @@ -924,7 +936,7 @@ int setup_files(struct thread_data *td) */ if (need_extend) { temp_stall_ts = 1; - if (output_format == FIO_OUTPUT_NORMAL) + if (output_format & FIO_OUTPUT_NORMAL) log_info("%s: Laying out IO file(s) (%u file(s) /" " %lluMB)\n", o->name, need_extend, extend_size >> 20);