aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Fu <vincent.fu@samsung.com>2024-01-19 17:30:57 +0000
committerVincent Fu <vincent.fu@samsung.com>2024-01-22 11:51:05 -0500
commit8b3190c3ea38af87778a68c576947f8797215d33 (patch)
treeaffc2329caae42c73c9a0f96f8179ca4bf4488d0
parentaa84b5ba581add84ce6e73b20ca0fbd04f6058c8 (diff)
downloadfio-8b3190c3ea38af87778a68c576947f8797215d33.tar.gz
filesetup: clear O_RDWR flag for verify_only write workloads
If verify_only is set we don't need to open the file with the O_RDWR flagi for write workloads. So we should clear this flag. This will help when the file is on a read-only file system. Fixes: https://github.com/axboe/fio/issues/1681 Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
-rw-r--r--filesetup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/filesetup.c b/filesetup.c
index 816d10816..2d277a642 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -749,6 +749,11 @@ open_again:
if (!read_only)
flags |= O_RDWR;
+ if (td->o.verify_only) {
+ flags &= ~O_RDWR;
+ flags |= O_RDONLY;
+ }
+
if (f->filetype == FIO_TYPE_FILE && td->o.allow_create)
flags |= O_CREAT;