Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 428b312c9b34fea3cd1db6d38b375fd1a14376e6..8a033485e7cf9eee2adbb893ab2d13bd2695dde0 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -377,6 +377,12 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u)
        if (minbs == maxbs)
                return minbs;
 
+       /*
+        * If we can't satisfy the min block size from here, then fail
+        */
+       if (!io_u_fits(td, io_u, minbs))
+               return 0;
+
        if (td->o.use_os_rand)
                rand_max = OS_RAND_MAX;
        else
@@ -1147,6 +1153,7 @@ static void small_content_scramble(struct io_u *io_u)
 
        p = io_u->xfer_buf;
        boffset = io_u->offset;
+       io_u->buf_filled_len = 0;
 
        for (i = 0; i < nr_blocks; i++) {
                /*