[PATCH] fio: size check was reversed
authorJens Axboe <axboe@suse.de>
Mon, 28 Nov 2005 15:08:15 +0000 (16:08 +0100)
committerJens Axboe <axboe@suse.de>
Mon, 28 Nov 2005 15:08:15 +0000 (16:08 +0100)
fio.c

diff --git a/fio.c b/fio.c
index e054c3545581d65775d8ac6d549b0ae99802f02b..9a87f60eb006517d490dd5c1f4a989f1c5120262 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1323,7 +1323,7 @@ static int file_size(struct thread_data *td)
        }
 
        if (td_read(td)) {
-               if (!td->file_size || td->file_size > st.st_size)
+               if (!td->file_size || (st.st_size > td->file_size))
                        td->file_size = st.st_size;
        } else {
                if (!td->file_size)
@@ -1342,7 +1342,7 @@ static int bdev_size(struct thread_data *td)
                return 1;
        }
 
-       if (!td->file_size || (td->file_size > bytes))
+       if (!td->file_size || (bytes > td->file_size))
                td->file_size = bytes;
 
        return 0;
@@ -1361,7 +1361,7 @@ static int get_file_size(struct thread_data *td)
                return ret;
 
        if (td->file_offset > td->file_size) {
-               fprintf(stderr, "Client%d: offset larger than length\n", td->thread_number);
+               fprintf(stderr, "Client%d: offset larger than length (%Lu > %Lu)\n", td->thread_number, td->file_offset, td->file_size);
                return 1;
        }