io_uring: sync header with the kernel
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 1604ff84b94edc14dea508589e683dfecdd95baa..bee99c3798d8474afcfaaa71a0bc8d1a0c7de2d8 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -570,8 +570,10 @@ static unsigned long long get_next_buflen(struct thread_data *td, struct io_u *i
                power_2 = is_power_of_2(minbs);
                if (!td->o.bs_unaligned && power_2)
                        buflen &= ~(minbs - 1);
-               else if (!td->o.bs_unaligned && !power_2) 
-                       buflen -= buflen % minbs; 
+               else if (!td->o.bs_unaligned && !power_2)
+                       buflen -= buflen % minbs;
+               if (buflen > maxbs)
+                       buflen = maxbs;
        } while (!io_u_fits(td, io_u, buflen));
 
        return buflen;