Don't check st_size for special files
authorJens Axboe <jens.axboe@oracle.com>
Thu, 22 Feb 2007 13:07:39 +0000 (14:07 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 22 Feb 2007 13:07:39 +0000 (14:07 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c

index 84cd7f7dfe2bffa93ed62d3ea7aaa790cd6e02b3..08742247d58c1f345303fbedb968c3594650aa48 100644 (file)
@@ -18,9 +18,15 @@ static int file_ok(struct thread_data *td, struct fio_file *f)
        if (td->filetype != FIO_TYPE_FILE || (td->io_ops->flags & FIO_NULLIO))
                return 0;
 
        if (td->filetype != FIO_TYPE_FILE || (td->io_ops->flags & FIO_NULLIO))
                return 0;
 
-       if (stat(f->file_name, &st) == -1)
+       if (lstat(f->file_name, &st) == -1)
                return 1;
                return 1;
-       else if (st.st_size < (off_t) f->file_size)
+
+       /*
+        * if it's a special file, size is always ok for now
+        */
+       if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))
+               return 0;
+       if (st.st_size < (off_t) f->file_size)
                return 1;
 
        return 0;
                return 1;
 
        return 0;