X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=1c529792afc952defb9f1422b8d1a953846b3f95;hp=abea1e60b726a8d82f503b054c83d76a66470210;hb=dfe11fd1e8249a52c42f34c9e9e6b910ab6b05c5;hpb=81795ce399bef3af497e5767546458e20ce81bbf diff --git a/filesetup.c b/filesetup.c index abea1e60..1c529792 100644 --- a/filesetup.c +++ b/filesetup.c @@ -395,9 +395,6 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, dprint(FD_IO, "invalidate cache %s: %llu/%llu\n", f->file_name, off, len); - /* - * FIXME: add blockdev flushing too - */ if (f->mmap_ptr) { ret = posix_madvise(f->mmap_ptr, f->mmap_sz, POSIX_MADV_DONTNEED); #ifdef FIO_MADV_FREE @@ -419,15 +416,18 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, } else if (f->filetype == FIO_TYPE_CHAR || f->filetype == FIO_TYPE_PIPE) ret = 0; - if (ret < 0) { - td_verror(td, errno, "invalidate_cache"); - return 1; - } else if (ret > 0) { - td_verror(td, ret, "invalidate_cache"); - return 1; + /* + * Cache flushing isn't a fatal condition, and we know it will + * happen on some platforms where we don't have the proper + * function to flush eg block device caches. So just warn and + * continue on our way. + */ + if (ret) { + log_info("fio: cache invalidation of %s failed: %s\n", f->file_name, strerror(errno)); + ret = 0; } - return ret; + return 0; }