From 7d993b1011529d2037a02f6192e5dce155ebcd8d Mon Sep 17 00:00:00 2001 From: Pan Xiao Date: Thu, 13 Jun 2024 09:09:00 +0800 Subject: [PATCH] For nfs engine, treat randwrite the same as write when opening file When use nfs engine, only write mode can work if file doesn't exist, otherwise user has to make sure file exists before test starts. This change will support randwrite mode when file doesn't exist. Pan Xiao --- engines/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/nfs.c b/engines/nfs.c index ce748d1448..f6032a2ecf 100644 --- a/engines/nfs.c +++ b/engines/nfs.c @@ -280,7 +280,7 @@ static int fio_libnfs_open(struct thread_data *td, struct fio_file *f) nfs_data = calloc(1, sizeof(struct nfs_data)); nfs_data->options = options; - if (td->o.td_ddir == TD_DDIR_WRITE) + if (td->o.td_ddir == TD_DDIR_WRITE || td->o.td_ddir == TD_DDIR_RANDWRITE) flags |= O_CREAT | O_RDWR; else flags |= O_RDWR;