Check for a valid block device size
authorJens Axboe <jens.axboe@oracle.com>
Mon, 2 Feb 2009 14:07:37 +0000 (15:07 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 2 Feb 2009 14:07:37 +0000 (15:07 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c

index 464c0f2..cfcfa9a 100644 (file)
@@ -156,6 +156,11 @@ static int bdev_size(struct thread_data *td, struct fio_file *f)
                return 1;
        }
 
+       if (!bytes) {
+               log_err("%s: zero sized block device?\n", f->file_name);
+               return 1;
+       }
+
        f->real_file_size = bytes;
        return 0;
 }