If we try to open a file with O_NOATIME and it fails, turn off
O_NOATIME and try again. This occurs if the user does not own
the file and is unprivileged.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
if (f->filetype != FIO_TYPE_FILE)
flags |= O_NOATIME;
if (f->filetype != FIO_TYPE_FILE)
flags |= O_NOATIME;
if (td_write(td)) {
assert(!read_only);
if (td_write(td)) {
assert(!read_only);
char buf[FIO_VERROR_SIZE];
int __e = errno;
char buf[FIO_VERROR_SIZE];
int __e = errno;
+ if (errno == EPERM && (flags & O_NOATIME)) {
+ flags &= ~O_NOATIME;
+ goto open_again;
+ }
+
snprintf(buf, sizeof(buf) - 1, "open(%s)", f->file_name);
td_verror(td, __e, buf);
snprintf(buf, sizeof(buf) - 1, "open(%s)", f->file_name);
td_verror(td, __e, buf);