zbd: do not check open zones status and limits when jobs do not write
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 22 Jan 2025 01:38:34 +0000 (10:38 +0900)
committerVincent Fu <vincentfu@gmail.com>
Wed, 22 Jan 2025 16:08:37 +0000 (11:08 -0500)
Currently, fio checks the conditions of each zone within the IO range at
the job start. If a zone is in an open condition, it is added to the
write target zone array. If the number of write target zones exceeds the
max_open_zones or job_max_open_zones limit, fio terminates with the
error message "Number of open zones exceeds max_open_zones limit". This
check for zone condition and the resulting termination occur even when
the job does not perform a write operation, leading to confusion among
users.

To avoid the confusion, skip the check when jobs do not perform write
operations. Additionally, print the message to inform that the
job_max_open_zones limit does not work for non-write jobs.

Fixes: 954217b90191 ("zbd: Initialize open zones list referring zone status at fio start")
Fixes: 8ac768899d63 ("zbd: do not reset extra zones in open conditions")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20250122013835.1223725-2-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincentfu@gmail.com>
zbd.c

diff --git a/zbd.c b/zbd.c
index 8a092cbe61db346330ed3a6e618db4fb4efb0d4c..ee095b1dd5f827bf5cfc94147c01606dd8c0f584 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -1264,6 +1264,16 @@ int zbd_setup_files(struct thread_data *td)
                        return 1;
                }
 
+               /*
+                * If this job does not do write operations, skip open zone
+                * condition check.
+                */
+               if (!td_write(td)) {
+                       if (td->o.job_max_open_zones)
+                               log_info("'job_max_open_zones' is valid only for write jobs\n");
+                       continue;
+               }
+
                /*
                 * The per job max open zones limit cannot be used without a
                 * global max open zones limit. (As the tracking of open zones