zbd: Make an error message more detailed
authorBart Van Assche <bvanassche@acm.org>
Fri, 19 May 2023 16:38:56 +0000 (09:38 -0700)
committerBart Van Assche <bvanassche@acm.org>
Fri, 19 May 2023 17:01:05 +0000 (10:01 -0700)
Knowing which part of a zone report is invalid is useful when debugging
firmware of zoned devices. Hence report the number of zones that have
been parsed successfully when reporting a report zones error.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
zbd.c

diff --git a/zbd.c b/zbd.c
index 351b3971ff07cab381fecdc46ffd6ee354b6441a..5f6b9ef4c5fcdd25b336d40c21e1ff59effae68b 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -213,8 +213,8 @@ static int zbd_report_zones(struct thread_data *td, struct fio_file *f,
                ret = blkzoned_report_zones(td, f, offset, zones, nr_zones);
        if (ret < 0) {
                td_verror(td, errno, "report zones failed");
-               log_err("%s: report zones from sector %"PRIu64" failed (%d).\n",
-                       f->file_name, offset >> 9, errno);
+               log_err("%s: report zones from sector %"PRIu64" failed (nr_zones=%d; errno=%d).\n",
+                       f->file_name, offset >> 9, nr_zones, errno);
        } else if (ret == 0) {
                td_verror(td, errno, "Empty zone report");
                log_err("%s: report zones from sector %"PRIu64" is empty.\n",