oslib: log BLKREPORTZONE error code
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Tue, 6 Feb 2024 10:57:52 +0000 (19:57 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Wed, 7 Feb 2024 13:43:13 +0000 (08:43 -0500)
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 <dmitry.fomichev@wdc.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240206105755.214891-3-dmitry.fomichev@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
oslib/linux-blkzoned.c

index 2c3ecf33b4cc31a2e6555bc64afec09d861c37d4..1cc8d288b49c9b80ea0cfb83d905934eab6e9419 100644 (file)
@@ -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;
        }