Dump actual filename in failure to open
authorJens Axboe <jens.axboe@oracle.com>
Wed, 21 Mar 2007 12:07:54 +0000 (13:07 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 21 Mar 2007 12:07:54 +0000 (13:07 +0100)
Helpful for debugging.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c
fio.h

index 289db8781d82535e5929db7cbc8f7bd45329920d..daae33ff47e36e2357082721f26c93ea82e7ef9d 100644 (file)
@@ -384,9 +384,12 @@ int generic_open_file(struct thread_data *td, struct fio_file *f)
        }
 
        if (f->fd == -1) {
+               char buf[FIO_VERROR_SIZE];
                int __e = errno;
 
-               td_verror(td, __e, "open");
+               snprintf(buf, sizeof(buf) - 1, "open(%s)", f->file_name);
+
+               td_verror(td, __e, buf);
                if (__e == EINVAL && td->o.odirect)
                        log_err("fio: destination does not support O_DIRECT\n");
                if (__e == EMFILE)
diff --git a/fio.h b/fio.h
index 2b4b3c65e1974926386f987b0f1aa462ed2fcdc5..ab8f1d9a28e13162d4b4b0c2e32d465e0d582fe7 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -411,12 +411,14 @@ struct thread_options {
        unsigned int cpucycle;
 };
 
+#define FIO_VERROR_SIZE        128
+
 /*
  * This describes a single thread/process executing a fio job.
  */
 struct thread_data {
        struct thread_options o;
-       char verror[128];
+       char verror[FIO_VERROR_SIZE];
        pthread_t thread;
        int thread_number;
        int groupid;