[PATCH] Update version string, fix offset bug fio-1.3
authorJens Axboe <axboe@suse.de>
Fri, 5 May 2006 09:11:22 +0000 (11:11 +0200)
committerJens Axboe <axboe@suse.de>
Fri, 5 May 2006 09:11:22 +0000 (11:11 +0200)
fio-ini.c
fio.c

index c94062279989285ed20a0326e2297f86bf94029b..611bdca884fd805ef175c6801491dd2874d14954 100644 (file)
--- a/fio-ini.c
+++ b/fio-ini.c
@@ -37,7 +37,7 @@
 #define DEF_ZONE_SIZE          (0)
 #define DEF_ZONE_SKIP          (0)
 
-static char fio_version_string[] = "fio 1.1";
+static char fio_version_string[] = "fio 1.3";
 
 static int repeatable = DEF_RAND_REPEAT;
 static char *ini_file;
diff --git a/fio.c b/fio.c
index e42c6795eae975fe8390a5fd484fb86717aeaaec..34e8f59662ce0474e4fcb124c4aefff709ab1497 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1209,6 +1209,7 @@ static int file_size(struct thread_data *td)
        if (!td->file_size || td->file_size > td->real_file_size)
                td->file_size = td->real_file_size;
 
+       td->file_size -= td->file_offset;
        return 0;
 }
 
@@ -1231,6 +1232,7 @@ static int bdev_size(struct thread_data *td)
        if (!td->file_size || td->file_size > td->real_file_size)
                td->file_size = td->real_file_size;
 
+       td->file_size -= td->file_offset;
        return 0;
 }
 
@@ -1248,8 +1250,8 @@ static int get_file_size(struct thread_data *td)
        if (ret)
                return ret;
 
-       if (td->file_offset + td->file_size > td->real_file_size) {
-               fprintf(stderr, "Client%d: offset extends end (%Lu > %Lu)\n", td->thread_number, td->file_offset + td->file_size, td->real_file_size);
+       if (td->file_offset > td->real_file_size) {
+               fprintf(stderr, "Client%d: offset extends end (%Lu > %Lu)\n", td->thread_number, td->file_offset, td->real_file_size);
                return 1;
        }