X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=08742247d58c1f345303fbedb968c3594650aa48;hp=84cd7f7dfe2bffa93ed62d3ea7aaa790cd6e02b3;hb=fa01d139c558a3788154c5b0f094bfdb5325728f;hpb=faf5c880f6ddcd44ff896ba1cf3da38b23fe0f39 diff --git a/filesetup.c b/filesetup.c index 84cd7f7d..08742247 100644 --- a/filesetup.c +++ b/filesetup.c @@ -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 (stat(f->file_name, &st) == -1) + if (lstat(f->file_name, &st) == -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;