zbd: print max_active_zones limit error message
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 19 Jul 2023 10:57:46 +0000 (19:57 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 20 Jul 2023 13:52:37 +0000 (09:52 -0400)
When zoned block devices have max_active_zones limit and when write
operations exceed that limit, Linux block sub-system reports EOVERFLOW.
However, the strerror() string for EOVERFLOW does not mention about
max_active_zones then it confuses users.

To avoid the confusion, print additional error message to indicate the
max_active_zones limit. For this purpose, add a hook function
zbd_log_err() and call it from __io_u_log_error().

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20230719105756.553146-4-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
io_u.c
zbd.c
zbd.h

diff --git a/io_u.c b/io_u.c
index 27b6c92ab99e6209db805563db5a58aed3ad527a..07e5bac5ef5257ec20af830cf3a5ef60f88123c7 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1879,6 +1879,8 @@ static void __io_u_log_error(struct thread_data *td, struct io_u *io_u)
                io_ddir_name(io_u->ddir),
                io_u->offset, io_u->xfer_buflen);
 
+       zbd_log_err(td, io_u);
+
        if (td->io_ops->errdetails) {
                char *err = td->io_ops->errdetails(io_u);
 
diff --git a/zbd.c b/zbd.c
index b05d2360d927062842c2a380ce19ed760e2f385d..caac68bb3731eed7ef5a9c4f68e560b39bdc35ad 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -2243,3 +2243,15 @@ int zbd_do_io_u_trim(struct thread_data *td, struct io_u *io_u)
 
        return io_u_completed;
 }
+
+void zbd_log_err(const struct thread_data *td, const struct io_u *io_u)
+{
+       const struct fio_file *f = io_u->file;
+
+       if (td->o.zone_mode != ZONE_MODE_ZBD)
+               return;
+
+       if (io_u->error == EOVERFLOW)
+               log_err("%s: Exceeded max_active_zones limit. Check conditions of zones out of I/O ranges.\n",
+                       f->file_name);
+}
diff --git a/zbd.h b/zbd.h
index a5cf59d1391aac6f267d21deb30afd9694d4b70a..5750a0b8088e7437ccdaa270a8997fa0bc1110af 100644 (file)
--- a/zbd.h
+++ b/zbd.h
@@ -105,6 +105,7 @@ enum fio_ddir zbd_adjust_ddir(struct thread_data *td, struct io_u *io_u,
 enum io_u_action zbd_adjust_block(struct thread_data *td, struct io_u *io_u);
 char *zbd_write_status(const struct thread_stat *ts);
 int zbd_do_io_u_trim(struct thread_data *td, struct io_u *io_u);
+void zbd_log_err(const struct thread_data *td, const struct io_u *io_u);
 
 static inline void zbd_close_file(struct fio_file *f)
 {