From db46d820d092aebd345b340c526b9dcbabc76748 Mon Sep 17 00:00:00 2001 From: Dmitry Fomichev Date: Tue, 6 Feb 2024 19:57:52 +0900 Subject: [PATCH] oslib: log BLKREPORTZONE error code BLKREPORTZONE may fail because of a variety of reasons. Log both the return code and errno when this ioctl fails. Signed-off-by: Dmitry Fomichev Reviewed-by: Shin'ichiro Kawasaki Tested-by: Shin'ichiro Kawasaki Link: https://lore.kernel.org/r/20240206105755.214891-3-dmitry.fomichev@wdc.com Signed-off-by: Vincent Fu --- oslib/linux-blkzoned.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oslib/linux-blkzoned.c b/oslib/linux-blkzoned.c index 2c3ecf33..1cc8d288 100644 --- a/oslib/linux-blkzoned.c +++ b/oslib/linux-blkzoned.c @@ -242,6 +242,8 @@ int blkzoned_report_zones(struct thread_data *td, struct fio_file *f, hdr->sector = offset >> 9; ret = ioctl(fd, BLKREPORTZONE, hdr); if (ret) { + log_err("%s: BLKREPORTZONE ioctl failed, ret=%d, err=%d.\n", + f->file_name, ret, -errno); ret = -errno; goto out; } -- 2.25.1