From 7d993b1011529d2037a02f6192e5dce155ebcd8d Mon Sep 17 00:00:00 2001 From: Pan Xiao Date: Thu, 13 Jun 2024 09:09:00 +0800 Subject: [PATCH 1/3] 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; From 02852cf38681da986ab5a755233b991646a224f1 Mon Sep 17 00:00:00 2001 From: Pan Xiao Date: Fri, 14 Jun 2024 08:37:33 +0800 Subject: [PATCH 2/3] in nfs engine, use td_write(td) to check if it is write or randwrite operation --- engines/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/nfs.c b/engines/nfs.c index f6032a2ecf..6bc4af1fac 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 || td->o.td_ddir == TD_DDIR_RANDWRITE) + if (td_write(td)) flags |= O_CREAT | O_RDWR; else flags |= O_RDWR; From f934e9970f3128746352e30e7419ac3f2a50e27a Mon Sep 17 00:00:00 2001 From: Pan Xiao Date: Fri, 14 Jun 2024 08:37:33 +0800 Subject: [PATCH 3/3] in nfs engine, use td_write(td) to check if it is write or randwrite operation --- engines/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/nfs.c b/engines/nfs.c index ce748d1448..6bc4af1fac 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_write(td)) flags |= O_CREAT | O_RDWR; else flags |= O_RDWR;