summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-02-02 15:07:37 +0100
committerJens Axboe <jens.axboe@oracle.com>2009-02-02 15:07:37 +0100
commit7ab077ab119fd28b6ccf5705ea8453e414f574c1 (patch)
treeec7b145d3f624aea2520b3302ebfdd434c1f8428
parent664fb3bde9ed3b61d0520b6b4f3d0ba9599834b0 (diff)
downloadfio-7ab077ab119fd28b6ccf5705ea8453e414f574c1.tar.gz
fio-7ab077ab119fd28b6ccf5705ea8453e414f574c1.tar.bz2
Check for a valid block device size
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--filesetup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/filesetup.c b/filesetup.c
index 464c0f20..cfcfa9ae 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -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;
}