From: Jens Axboe Date: Thu, 22 Feb 2007 13:07:39 +0000 (+0100) Subject: Don't check st_size for special files X-Git-Tag: fio-1.12~27 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=fa01d139c558a3788154c5b0f094bfdb5325728f;ds=sidebyside Don't check st_size for special files Signed-off-by: Jens Axboe --- 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;