Fail if we can't satisfy the minimum block size
Commit 799441286648bdced4f42d3040f37fd2e35eaf1d introduced a bug
where if we cannot satisfy the minimum block size from a given
offset, then we will loop forever trying to do that. Fix that bug
checking early if it is indeed a possible thing to satisfy, if
not give up.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/io_u.c b/io_u.c
index 54f8685..8a03348 100644
--- a/io_u.c
+++ b/io_u.c
@@ -377,6 +377,12 @@
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