unsigned int bs;
char *b;
+ if (read_only) {
+ log_err("fio: refusing extend of file due to read-only\n");
+ return 0;
+ }
+
/*
* check if we need to lay the file out complete again. fio
* does that for operations involving reads, or for writes
flags |= OS_O_DIRECT;
if (td->o.sync_io)
flags |= O_SYNC;
+ if (f->filetype != FIO_TYPE_FILE)
+ flags |= O_NOATIME;
if (td_write(td)) {
+ assert(!read_only);
+
flags |= O_RDWR;
if (f->filetype == FIO_TYPE_FILE)
else
f->fd = open(f->file_name, flags, 0600);
} else {
- if (f->filetype == FIO_TYPE_CHAR)
+ if (f->filetype == FIO_TYPE_CHAR && !read_only)
flags |= O_RDWR;
else
flags |= O_RDONLY;
/*
* device/file sizes are zero and no size given, punt
*/
- if ((!total_size || total_size == -1ULL) && !td->o.size) {
+ if ((!total_size || total_size == -1ULL) && !td->o.size &&
+ !(td->io_ops->flags & FIO_NOIO)) {
log_err("%s: you need to specify size=\n", td->o.name);
td_verror(td, EINVAL, "total_file_size");
return 1;
if (!td->o.zone_size)
td->o.zone_size = td->o.size;
- td->total_io_size = td->o.size * td->o.loops;
+ /*
+ * iolog already set the total io size, if we read back
+ * stored entries.
+ */
+ if (!td->o.read_iolog_file)
+ td->total_io_size = td->o.size * td->o.loops;
return 0;
err_offset:
log_err("%s: you need to specify valid offset=\n", td->o.name);