rand: fix compressible data ratio per segment
[fio.git] / lib / rand.c
index 99846a8d0fdd553e9fa3faea39f73c6971da13ac..f18bd8d84e9cf021cd49a8df3dc931f47d7f35e2 100644 (file)
@@ -166,6 +166,7 @@ void __fill_random_buf_percentage(unsigned long seed, void *buf,
                if (!len)
                        break;
                buf += this_len;
+               this_len = segment - this_len;
 
                if (this_len > len)
                        this_len = len;