X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=57928133369cdd520a1b89052cbc9362b773ca78;hp=7ed47a25b5846108125e1028f30fa51d9cb87425;hb=0d1cd207e409a36313784cb9596990c819775f77;hpb=d6aed795f2e3e403828abf60874dd2d6e8342a1b diff --git a/filesetup.c b/filesetup.c index 7ed47a25..57928133 100644 --- a/filesetup.c +++ b/filesetup.c @@ -13,6 +13,12 @@ static int root_warn; +static inline void clear_error(struct thread_data *td) +{ + td->error = 0; + td->verror[0] = '\0'; +} + /* * Leaves f->fd open on success, caller must close */ @@ -126,7 +132,7 @@ static int extend_file(struct thread_data *td, struct fio_file *f) goto err; } } - if (td->o.fill_device) { + if (td->o.fill_device && !td_write(td)) { fio_file_clear_size_known(f); if (td_io_get_file_size(td, f)) goto err; @@ -284,6 +290,9 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, if (off == -1ULL) off = f->file_offset; + if (len == -1ULL || off == -1ULL) + return 0; + dprint(FD_IO, "invalidate cache %s: %llu/%llu\n", f->file_name, off, len);